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
a3e2696480
commit
2f472dd63b
@ -45,8 +45,7 @@ NS_IMPL_ISUPPORTS1(nsSecurityNameSet, nsIScriptExternalNameSet)
|
|||||||
static JSBool
|
static JSBool
|
||||||
netscape_security_enablePrivilege(JSContext *cx, unsigned argc, jsval *vp)
|
netscape_security_enablePrivilege(JSContext *cx, unsigned argc, jsval *vp)
|
||||||
{
|
{
|
||||||
xpc::EnableUniversalXPConnect(cx);
|
return xpc::EnableUniversalXPConnect(cx);
|
||||||
return JS_TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static JSFunctionSpec PrivilegeManager_static_methods[] = {
|
static JSFunctionSpec PrivilegeManager_static_methods[] = {
|
||||||
|
@ -4397,16 +4397,21 @@ inline bool IsUniversalXPConnectEnabled(JSContext *cx)
|
|||||||
return IsUniversalXPConnectEnabled(compartment);
|
return IsUniversalXPConnectEnabled(compartment);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline void EnableUniversalXPConnect(JSContext *cx)
|
inline bool EnableUniversalXPConnect(JSContext *cx)
|
||||||
{
|
{
|
||||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||||
if (!compartment)
|
if (!compartment)
|
||||||
return;
|
return true;
|
||||||
CompartmentPrivate *priv =
|
CompartmentPrivate *priv =
|
||||||
static_cast<CompartmentPrivate*>(JS_GetCompartmentPrivate(compartment));
|
static_cast<CompartmentPrivate*>(JS_GetCompartmentPrivate(compartment));
|
||||||
if (!priv)
|
if (!priv)
|
||||||
return;
|
return true;
|
||||||
priv->universalXPConnectEnabled = 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