Backed out changeset e0427b37129b (bug 1566868) for turning Bug1528607 into permafail CLOSED TREE

This commit is contained in:
Noemi Erli 2019-10-08 22:25:20 +03:00
parent 9cde4e3ef1
commit a0c197288b

View File

@ -7376,26 +7376,19 @@ nsresult nsHttpChannel::ComputeCrossOriginOpenerPolicyMismatch() {
RefPtr<mozilla::dom::BrowsingContext> ctx;
mLoadInfo->GetBrowsingContext(getter_AddRefs(ctx));
RefPtr<BrowsingContext> inherit = ctx->GetParent();
if (!inherit) {
inherit = ctx->GetOpener();
}
if (!inherit || !inherit->Top()->Canonical()->GetCurrentWindowGlobal()) {
return NS_ERROR_NOT_AVAILABLE;
}
// Get the policy of the active document, and the policy for the result.
nsILoadInfo::CrossOriginOpenerPolicy documentPolicy = ctx->GetOpenerPolicy();
nsILoadInfo::CrossOriginOpenerPolicy resultPolicy =
nsILoadInfo::OPENER_POLICY_NULL;
Unused << GetCrossOriginOpenerPolicy(documentPolicy, &resultPolicy);
if (!ctx->Canonical()->GetCurrentWindowGlobal()) {
return NS_ERROR_NOT_AVAILABLE;
}
// We use the top window principal as the documentOrigin
nsCOMPtr<nsIPrincipal> documentOrigin = inherit->Top()
->Canonical()
->GetCurrentWindowGlobal()
->DocumentPrincipal();
nsCOMPtr<nsIPrincipal> documentOrigin =
ctx->Canonical()->GetCurrentWindowGlobal()->DocumentPrincipal();
nsCOMPtr<nsIPrincipal> resultOrigin;
nsContentUtils::GetSecurityManager()->GetChannelResultPrincipal(