mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 788914 - Recompute cross-compartment wrappers when UniversalXPConnect is enabled. r=mrbkap
This commit is contained in:
parent
a163a6189b
commit
29a085d3bc
@ -45,8 +45,7 @@ NS_IMPL_ISUPPORTS1(nsSecurityNameSet, nsIScriptExternalNameSet)
|
||||
static JSBool
|
||||
netscape_security_enablePrivilege(JSContext *cx, unsigned argc, jsval *vp)
|
||||
{
|
||||
xpc::EnableUniversalXPConnect(cx);
|
||||
return JS_TRUE;
|
||||
return xpc::EnableUniversalXPConnect(cx);
|
||||
}
|
||||
|
||||
static JSFunctionSpec PrivilegeManager_static_methods[] = {
|
||||
|
@ -4397,16 +4397,21 @@ inline bool IsUniversalXPConnectEnabled(JSContext *cx)
|
||||
return IsUniversalXPConnectEnabled(compartment);
|
||||
}
|
||||
|
||||
inline void EnableUniversalXPConnect(JSContext *cx)
|
||||
inline bool EnableUniversalXPConnect(JSContext *cx)
|
||||
{
|
||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||
if (!compartment)
|
||||
return;
|
||||
return true;
|
||||
CompartmentPrivate *priv =
|
||||
static_cast<CompartmentPrivate*>(JS_GetCompartmentPrivate(compartment));
|
||||
if (!priv)
|
||||
return;
|
||||
return true;
|
||||
priv->universalXPConnectEnabled = true;
|
||||
|
||||
// Recompute all the cross-compartment wrappers leaving the newly-privileged
|
||||
// compartment.
|
||||
return js::RecomputeWrappers(cx, js::SingleCompartment(compartment),
|
||||
js::AllCompartments());
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user