Backed out changeset e0427b37129b (bug 1566868) for turning Bug1528607 into permafail CLOSED TREE
authorNoemi Erli <nerli@mozilla.com>
Tue, 08 Oct 2019 22:25:20 +0300
changeset 496806 b44da78c9070d87870a6fb5ce924b273dcae8369
parent 496805 258c68e013454a876c4c65a2556a43d4739a26c4
child 496807 52abae8658fc0611943f3d7fb41a0ae75fcc580b
push id36668
push useraiakab@mozilla.com
push dateWed, 09 Oct 2019 04:06:09 +0000
treeherdermozilla-central@26ebfec08834 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1566868, 1528607
milestone71.0a1
backs oute0427b37129bb0272be31d8d212db607db776f5c
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset e0427b37129b (bug 1566868) for turning Bug1528607 into permafail CLOSED TREE
netwerk/protocol/http/nsHttpChannel.cpp
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -7371,36 +7371,29 @@ nsresult nsHttpChannel::ComputeCrossOrig
       mResponseHead ? mResponseHead : mCachedResponseHead;
   if (!head) {
     return NS_ERROR_NOT_AVAILABLE;
   }
 
   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(
       this, getter_AddRefs(resultOrigin));
 
   bool compareResult = CompareCrossOriginOpenerPolicies(
       documentPolicy, documentOrigin, resultPolicy, resultOrigin);