mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 823348 - Uninline UniversalXPConnect management. r=mrbkap
Every time the layout of CompartmentPrivate changes, I forget to rebuild in caps/ and spend half an hour wondering what the heck is going on. :-(
This commit is contained in:
parent
a5faa58c98
commit
71cfd0816b
@ -232,6 +232,41 @@ EnsureCompartmentPrivate(JSObject *obj)
|
||||
return priv;
|
||||
}
|
||||
|
||||
bool
|
||||
IsUniversalXPConnectEnabled(JSCompartment *compartment)
|
||||
{
|
||||
CompartmentPrivate *priv = GetCompartmentPrivate(compartment);
|
||||
if (!priv)
|
||||
return false;
|
||||
return priv->universalXPConnectEnabled;
|
||||
}
|
||||
|
||||
bool
|
||||
IsUniversalXPConnectEnabled(JSContext *cx)
|
||||
{
|
||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||
if (!compartment)
|
||||
return false;
|
||||
return IsUniversalXPConnectEnabled(compartment);
|
||||
}
|
||||
|
||||
bool
|
||||
EnableUniversalXPConnect(JSContext *cx)
|
||||
{
|
||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||
if (!compartment)
|
||||
return true;
|
||||
CompartmentPrivate *priv = GetCompartmentPrivate(compartment);
|
||||
if (!priv)
|
||||
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());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -4361,37 +4361,9 @@ GetCompartmentPrivate(JSObject *object)
|
||||
return GetCompartmentPrivate(compartment);
|
||||
}
|
||||
|
||||
inline bool IsUniversalXPConnectEnabled(JSCompartment *compartment)
|
||||
{
|
||||
CompartmentPrivate *priv = GetCompartmentPrivate(compartment);
|
||||
if (!priv)
|
||||
return false;
|
||||
return priv->universalXPConnectEnabled;
|
||||
}
|
||||
|
||||
inline bool IsUniversalXPConnectEnabled(JSContext *cx)
|
||||
{
|
||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||
if (!compartment)
|
||||
return false;
|
||||
return IsUniversalXPConnectEnabled(compartment);
|
||||
}
|
||||
|
||||
inline bool EnableUniversalXPConnect(JSContext *cx)
|
||||
{
|
||||
JSCompartment *compartment = js::GetContextCompartment(cx);
|
||||
if (!compartment)
|
||||
return true;
|
||||
CompartmentPrivate *priv = GetCompartmentPrivate(compartment);
|
||||
if (!priv)
|
||||
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());
|
||||
}
|
||||
bool IsUniversalXPConnectEnabled(JSCompartment *compartment);
|
||||
bool IsUniversalXPConnectEnabled(JSContext *cx);
|
||||
bool EnableUniversalXPConnect(JSContext *cx);
|
||||
|
||||
// This returns null if and only if it is called on an object in a non-XPConnect
|
||||
// compartment.
|
||||
|
Loading…
Reference in New Issue
Block a user