mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 821850 - Check for XBL scopes in nsContentUtils::IsCallerXBL(). r=bz
This commit is contained in:
parent
b757981155
commit
032bee38ff
@ -1752,7 +1752,13 @@ nsContentUtils::IsCallerXBL()
|
||||
{
|
||||
JSScript *script;
|
||||
JSContext *cx = GetCurrentJSContext();
|
||||
if (!cx || !JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
|
||||
if (!cx)
|
||||
return false;
|
||||
// New Hotness.
|
||||
if (xpc::IsXBLScope(js::GetContextCompartment(cx)))
|
||||
return true;
|
||||
// XBL scopes are behind a pref, so check the XBL bit as well.
|
||||
if (!JS_DescribeScriptedCaller(cx, &script, nullptr) || !script)
|
||||
return false;
|
||||
return JS_GetScriptUserBit(script);
|
||||
}
|
||||
|
@ -237,6 +237,16 @@ EnsureCompartmentPrivate(JSCompartment *c)
|
||||
return priv;
|
||||
}
|
||||
|
||||
bool
|
||||
IsXBLScope(JSCompartment *compartment)
|
||||
{
|
||||
// We always eagerly create compartment privates for XBL scopes.
|
||||
CompartmentPrivate *priv = GetCompartmentPrivate(compartment);
|
||||
if (!priv || !priv->scope)
|
||||
return false;
|
||||
return priv->scope->IsXBLScope();
|
||||
}
|
||||
|
||||
bool
|
||||
IsUniversalXPConnectEnabled(JSCompartment *compartment)
|
||||
{
|
||||
|
@ -333,6 +333,8 @@ bool StringToJsval(JSContext* cx, mozilla::dom::DOMString& str,
|
||||
|
||||
nsIPrincipal *GetCompartmentPrincipal(JSCompartment *compartment);
|
||||
|
||||
bool IsXBLScope(JSCompartment *compartment);
|
||||
|
||||
void DumpJSHeap(FILE* file);
|
||||
|
||||
void SetLocationForGlobal(JSObject *global, const nsACString& location);
|
||||
|
Loading…
Reference in New Issue
Block a user