Backed out changeset a0f243dead30 (bug 1301649) for developers' request
authorIris Hsiao <ihsiao@mozilla.com>
Thu, 20 Oct 2016 15:24:50 +0800
changeset 361506 99a239e1866a57f987b08dad796528e4ea30e622
parent 361505 998ad5a74da80fe63664a8dcf30d8f269ffe4e65
child 361507 fea50f378562fed69779e85113bcbacaffdcd587
child 361530 fa8b4ec489c139be5f30fbe28cd79e7aa8697ba0
child 361573 4df5cda574b9e5ee6d5d4eb12371f6dd6e90f2b4
push id6795
push userjlund@mozilla.com
push dateMon, 23 Jan 2017 14:19:46 +0000
treeherdermozilla-beta@76101b503191 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1301649
milestone52.0a1
backs outa0f243dead30790a4d2ab082be4a3b6e5aa0eb01
first release with
nightly linux32
99a239e1866a / 52.0a1 / 20161020030211 / files
nightly linux64
99a239e1866a / 52.0a1 / 20161020030211 / files
nightly mac
99a239e1866a / 52.0a1 / 20161020030211 / files
nightly win32
99a239e1866a / 52.0a1 / 20161020030211 / files
nightly win64
99a239e1866a / 52.0a1 / 20161020030211 / files
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset a0f243dead30 (bug 1301649) for developers' request
dom/base/nsFrameLoader.cpp
netwerk/protocol/http/HttpBaseChannel.cpp
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -2084,17 +2084,20 @@ nsFrameLoader::MaybeCreateDocShell()
   // For example, firstPartyDomain is computed from top-level document, it
   // doesn't exist in the top-level docshell.
   if (parentType == nsIDocShellTreeItem::typeContent &&
       !nsContentUtils::IsSystemPrincipal(doc->NodePrincipal()) &&
       !OwnerIsMozBrowserOrAppFrame()) {
     PrincipalOriginAttributes poa = BasePrincipal::Cast(doc->NodePrincipal())->OriginAttributesRef();
 
     // Assert on the firstPartyDomain from top-level docshell should be empty
-    MOZ_ASSERT_IF(mIsTopLevelContent, attrs.mFirstPartyDomain.IsEmpty());
+    if (mIsTopLevelContent) {
+      MOZ_ASSERT(attrs.mFirstPartyDomain.IsEmpty(),
+                 "top-level docshell shouldn't have firstPartyDomain attribute.");
+    }
 
     // So far we want to make sure InheritFromDocToChildDocShell doesn't override
     // any other origin attribute than firstPartyDomain.
     MOZ_ASSERT(attrs.mAppId == poa.mAppId,
               "docshell and document should have the same appId attribute.");
     MOZ_ASSERT(attrs.mUserContextId == poa.mUserContextId,
               "docshell and document should have the same userContextId attribute.");
     MOZ_ASSERT(attrs.mInIsolatedMozBrowser == poa.mInIsolatedMozBrowser,
--- a/netwerk/protocol/http/HttpBaseChannel.cpp
+++ b/netwerk/protocol/http/HttpBaseChannel.cpp
@@ -2940,40 +2940,41 @@ HttpBaseChannel::SetupReplacementChannel
   if (mLoadInfo) {
     nsCOMPtr<nsILoadInfo> newLoadInfo =
       static_cast<mozilla::LoadInfo*>(mLoadInfo.get())->Clone();
 
     // re-compute the origin attributes of the loadInfo if it's top-level load.
     bool isTopLevelDoc =
       newLoadInfo->GetExternalContentPolicyType() == nsIContentPolicy::TYPE_DOCUMENT;
 
-    nsCOMPtr<nsILoadContext> loadContext;
-    NS_QueryNotificationCallbacks(this, loadContext);
-    DocShellOriginAttributes docShellAttrs;
-    if (loadContext) {
-      loadContext->GetOriginAttributes(docShellAttrs);
+    if (isTopLevelDoc) {
+      nsCOMPtr<nsILoadContext> loadContext;
+      NS_QueryNotificationCallbacks(this, loadContext);
+      DocShellOriginAttributes docShellAttrs;
+      if (loadContext) {
+        loadContext->GetOriginAttributes(docShellAttrs);
+      }
+      MOZ_ASSERT(docShellAttrs.mFirstPartyDomain.IsEmpty(),
+                 "top-level docshell shouldn't have firstPartyDomain attribute.");
+
+      NeckoOriginAttributes attrs = newLoadInfo->GetOriginAttributes();
+
+      MOZ_ASSERT(docShellAttrs.mAppId == attrs.mAppId,
+                "docshell and necko should have the same appId attribute.");
+      MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId,
+                "docshell and necko should have the same userContextId attribute.");
+      MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser,
+                "docshell and necko should have the same inIsolatedMozBrowser attribute.");
+      MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
+                 "docshell and necko should have the same privateBrowsingId attribute.");
+
+      attrs.InheritFromDocShellToNecko(docShellAttrs, true, newURI);
+      newLoadInfo->SetOriginAttributes(attrs);
     }
 
-    // top-level docshell shouldn't have firstPartyDomain attribute.
-    MOZ_ASSERT_IF(isTopLevelDoc, docShellAttrs.mFirstPartyDomain.IsEmpty());
-
-    NeckoOriginAttributes attrs = newLoadInfo->GetOriginAttributes();
-
-    MOZ_ASSERT(docShellAttrs.mAppId == attrs.mAppId,
-               "docshell and necko should have the same appId attribute.");
-    MOZ_ASSERT(docShellAttrs.mUserContextId == attrs.mUserContextId,
-               "docshell and necko should have the same userContextId attribute.");
-    MOZ_ASSERT(docShellAttrs.mInIsolatedMozBrowser == attrs.mInIsolatedMozBrowser,
-               "docshell and necko should have the same inIsolatedMozBrowser attribute.");
-    MOZ_ASSERT(docShellAttrs.mPrivateBrowsingId == attrs.mPrivateBrowsingId,
-               "docshell and necko should have the same privateBrowsingId attribute.");
-
-    attrs.InheritFromDocShellToNecko(docShellAttrs, isTopLevelDoc, newURI);
-    newLoadInfo->SetOriginAttributes(attrs);
-
     bool isInternalRedirect =
       (redirectFlags & (nsIChannelEventSink::REDIRECT_INTERNAL |
                         nsIChannelEventSink::REDIRECT_STS_UPGRADE));
     newLoadInfo->AppendRedirectedPrincipal(GetURIPrincipal(), isInternalRedirect);
     newChannel->SetLoadInfo(newLoadInfo);
   }
   else {
     // the newChannel was created with a dummy loadInfo, we should clear