Bug 1379023, part 3 - Make WriteCachedScript assert about the system principal not require the argument. r=mrbkap
MozReview-Commit-ID: FRgjZ32ULqj
This commit is contained in:
@@ -204,19 +204,6 @@ EvalScript(JSContext* cx,
|
||||
cachePath.AppendPrintf("jssubloader/%d", version);
|
||||
PathifyURI(uri, cachePath);
|
||||
|
||||
nsCOMPtr<nsIScriptSecurityManager> secman =
|
||||
do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID);
|
||||
if (!secman) {
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIPrincipal> principal;
|
||||
nsresult rv = secman->GetSystemPrincipal(getter_AddRefs(principal));
|
||||
if (NS_FAILED(rv) || !principal) {
|
||||
ReportError(cx, LOAD_ERROR_NOPRINCIPALS, uri);
|
||||
return false;
|
||||
}
|
||||
|
||||
nsCString uriStr;
|
||||
if (preloadCache && NS_SUCCEEDED(uri->GetSpec(uriStr))) {
|
||||
// Note that, when called during startup, this will keep the
|
||||
@@ -244,8 +231,7 @@ EvalScript(JSContext* cx,
|
||||
|
||||
if (startupCache) {
|
||||
JSAutoCompartment ac(cx, script);
|
||||
WriteCachedScript(StartupCache::GetSingleton(),
|
||||
cachePath, cx, principal, script);
|
||||
WriteCachedScript(StartupCache::GetSingleton(), cachePath, cx, script);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user