зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1094953: Ensure that GetGlobalJSObject on the native global does not return null in nsXPCWrappedJSClass::DelegatedQueryInterface. r=bholley
This commit is contained in:
Родитель
147b2557d7
Коммит
15061e2136
|
@ -508,8 +508,13 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self,
|
|||
|
||||
// QI on an XPCWrappedJS can run script, so we need an AutoEntryScript.
|
||||
// This is inherently Gecko-specific.
|
||||
// We check both nativeGlobal and nativeGlobal->GetGlobalJSObject() even
|
||||
// though we have derived nativeGlobal from the JS global, because we know
|
||||
// there are cases where this can happen. See bug 1094953.
|
||||
nsIGlobalObject* nativeGlobal =
|
||||
NativeGlobal(js::GetGlobalForObjectCrossCompartment(self->GetJSObject()));
|
||||
NS_ENSURE_TRUE(nativeGlobal, NS_ERROR_FAILURE);
|
||||
NS_ENSURE_TRUE(nativeGlobal->GetGlobalJSObject(), NS_ERROR_FAILURE);
|
||||
AutoEntryScript aes(nativeGlobal, /* aIsMainThread = */ true);
|
||||
XPCCallContext ccx(NATIVE_CALLER, aes.cx());
|
||||
if (!ccx.IsValid()) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче