Bug 1517483 - Get rid of nsIScriptSecurityManager::IsSystemPrincipal r=bzbarsky

Replaced instances of callers in both C++ and JS files to query the state from the principal directly.

Differential Revision: https://phabricator.services.mozilla.com/D22532
This commit is contained in:
sakshaat
2019-03-24 20:36:25 +00:00
parent f3854cc1ec
commit 8b67bd2a1d
29 changed files with 41 additions and 93 deletions

View File

@@ -210,12 +210,9 @@ namespace {
bool IsChromeJSScript(JSScript* aScript) {
// May be called from another thread or inside a signal handler.
// We assume querying the script is safe but we must not manipulate it.
nsIScriptSecurityManager* const secman =
nsScriptSecurityManager::GetScriptSecurityManager();
NS_ENSURE_TRUE(secman, false);
JSPrincipals* const principals = JS_GetScriptPrincipals(aScript);
return secman->IsSystemPrincipal(nsJSPrincipals::get(principals));
return nsJSPrincipals::get(principals)->IsSystemPrincipal();
}
// Get the full path after the URI scheme, if the URI matches the scheme.