mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-26 11:45:37 +00:00
Bug 1464374 part 6 - Use GetRealmPrincipals in Scriptability constructor. r=bz
This commit is contained in:
parent
1c0105d7ef
commit
1edb6a4c17
@ -197,7 +197,7 @@ CompartmentPrivate::SystemIsBeingShutDown()
|
||||
}
|
||||
|
||||
RealmPrivate::RealmPrivate(JS::Realm* realm)
|
||||
: scriptability(JS::GetCompartmentForRealm(realm))
|
||||
: scriptability(realm)
|
||||
, scope(nullptr)
|
||||
{
|
||||
}
|
||||
@ -367,11 +367,11 @@ PrincipalImmuneToScriptPolicy(nsIPrincipal* aPrincipal)
|
||||
return false;
|
||||
}
|
||||
|
||||
Scriptability::Scriptability(JSCompartment* c) : mScriptBlocks(0)
|
||||
Scriptability::Scriptability(JS::Realm* realm) : mScriptBlocks(0)
|
||||
, mDocShellAllowsScript(true)
|
||||
, mScriptBlockedByPolicy(false)
|
||||
{
|
||||
nsIPrincipal* prin = nsJSPrincipals::get(JS_GetCompartmentPrincipals(c));
|
||||
nsIPrincipal* prin = nsJSPrincipals::get(JS::GetRealmPrincipals(realm));
|
||||
mImmuneToScriptPolicy = PrincipalImmuneToScriptPolicy(prin);
|
||||
|
||||
// If we're not immune, we should have a real principal with a codebase URI.
|
||||
|
@ -43,7 +43,7 @@ namespace xpc {
|
||||
|
||||
class Scriptability {
|
||||
public:
|
||||
explicit Scriptability(JSCompartment* c);
|
||||
explicit Scriptability(JS::Realm* realm);
|
||||
bool Allowed();
|
||||
bool IsImmuneToScriptPolicy();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user