mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 937317 - Return null from ToWebIDLCallback if one doesn't already exist. r=bz
This commit is contained in:
parent
904374035f
commit
d843f5b707
@ -348,29 +348,7 @@ public:
|
||||
nsRefPtr<WebIDLCallbackT> callback = GetWebIDLCallback();
|
||||
return callback.forget();
|
||||
}
|
||||
|
||||
XPCOMCallbackT* callback = GetXPCOMCallback();
|
||||
if (!callback) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIXPConnectWrappedJS> wrappedJS = do_QueryInterface(callback);
|
||||
if (!wrappedJS) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
AutoSafeJSContext cx;
|
||||
|
||||
JS::Rooted<JSObject*> obj(cx, wrappedJS->GetJSObject());
|
||||
if (!obj) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
JSAutoCompartment ac(cx, obj);
|
||||
|
||||
// XXXbholley - This goes away in the next patch.
|
||||
nsRefPtr<WebIDLCallbackT> newCallback = new WebIDLCallbackT(obj, /* aIncumbentGlobal = */ nullptr);
|
||||
return newCallback.forget();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user