Backed out changeset 17c47c036980 (bug 937317) WinXP Build Bustage on a CLOSED TREE

This commit is contained in:
Carsten "Tomcat" Book 2013-12-06 08:41:50 +01:00
parent abe0ad0b33
commit 5f78db1159

View File

@ -349,7 +349,29 @@ public:
nsRefPtr<WebIDLCallbackT> callback = GetWebIDLCallback();
return callback.forget();
}
return nullptr;
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();
}
private: