Backed out changeset ca88862d6b63 (bug 1558915) for causing build bustages on StartupCacheUtils. CLOSED TREE

This commit is contained in:
Cosmin Sabou
2019-08-07 13:20:32 +03:00
parent 45d1285b6b
commit 1f03c5075f
20 changed files with 134 additions and 56 deletions

View File

@@ -688,6 +688,8 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
"security.view-source.reachable-from-inner-protocol");
}
bool targetIsViewSource = false;
if (sourceScheme.LowerCaseEqualsLiteral(NS_NULLPRINCIPAL_SCHEME)) {
// A null principal can target its own URI.
if (sourceURI == aTargetURI) {
@@ -695,7 +697,9 @@ nsScriptSecurityManager::CheckLoadURIWithPrincipal(nsIPrincipal* aPrincipal,
}
} else if (sViewSourceReachableFromInner &&
sourceScheme.EqualsIgnoreCase(targetScheme.get()) &&
aTargetURI->SchemeIs("view-source")) {
NS_SUCCEEDED(
aTargetURI->SchemeIs("view-source", &targetIsViewSource)) &&
targetIsViewSource) {
// exception for foo: linking to view-source:foo for reftests...
return NS_OK;
} else if (sourceScheme.EqualsIgnoreCase("file") &&
@@ -944,7 +948,9 @@ nsresult nsScriptSecurityManager::CheckLoadURIFlags(
}
// Allow chrome://
if (aSourceBaseURI->SchemeIs("chrome")) {
bool isChrome = false;
if (NS_SUCCEEDED(aSourceBaseURI->SchemeIs("chrome", &isChrome)) &&
isChrome) {
return NS_OK;
}