зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1254847 part 1. Take ownership of error reporting on the AutoEntryScript in nsXPCWrappedJSClass::DelegatedQueryInterface. r=bholley
If a QI method throws anything other than NS_NOINTERFACE, we should just report it and propagate NS_NOINTERFACE out to callers. And if it throws NS_NOINTERFACE, then we already clear the pending exception in nsXPCWrappedJSClass::CallQueryInterfaceOnJSObject, then turn the null return value into a C++ NS_NOINTERFACE return.
This commit is contained in:
Родитель
53011a6a05
Коммит
0f63c48348
|
@ -515,6 +515,7 @@ nsXPCWrappedJSClass::DelegatedQueryInterface(nsXPCWrappedJS* self,
|
|||
NS_ENSURE_TRUE(nativeGlobal->GetGlobalJSObject(), NS_ERROR_FAILURE);
|
||||
AutoEntryScript aes(nativeGlobal, "XPCWrappedJS QueryInterface",
|
||||
/* aIsMainThread = */ true);
|
||||
aes.TakeOwnershipOfErrorReporting();
|
||||
XPCCallContext ccx(NATIVE_CALLER, aes.cx());
|
||||
if (!ccx.IsValid()) {
|
||||
*aInstancePtr = nullptr;
|
||||
|
|
Загрузка…
Ссылка в новой задаче