mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-21 01:05:45 +00:00
Backed out changeset e0427b37129b (bug 1566868) for turning Bug1528607 into permafail CLOSED TREE
This commit is contained in:
parent
9cde4e3ef1
commit
a0c197288b
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user