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:
Boris Zbarsky 2016-03-09 19:02:03 -05:00
Родитель 53011a6a05
Коммит 0f63c48348
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -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;