Bug 958641 - De-holder nsIXPConnect::WrapNative. r=gabor

This commit is contained in:
Andrew McCreight
2015-07-01 11:17:17 -07:00
parent 3bd2be7bba
commit ad1470555c
12 changed files with 79 additions and 104 deletions

View File

@@ -1232,13 +1232,9 @@ _getpluginelement(NPP npp)
nsCOMPtr<nsIXPConnect> xpc(do_GetService(nsIXPConnect::GetCID()));
NS_ENSURE_TRUE(xpc, nullptr);
nsCOMPtr<nsIXPConnectJSObjectHolder> holder;
JS::RootedObject obj(cx);
xpc->WrapNative(cx, ::JS::CurrentGlobalOrNull(cx), element,
NS_GET_IID(nsIDOMElement),
getter_AddRefs(holder));
NS_ENSURE_TRUE(holder, nullptr);
JS::Rooted<JSObject*> obj(cx, holder->GetJSObject());
NS_GET_IID(nsIDOMElement), obj.address());
NS_ENSURE_TRUE(obj, nullptr);
return nsJSObjWrapper::GetNewOrUsed(npp, cx, obj);