Backed out changeset e72aaa3b621e (bug 1334047) for bustage
authorCarsten "Tomcat" Book <cbook@mozilla.com>
Mon, 30 Jan 2017 16:23:40 +0100
changeset 378027 13afabf5d79de6cfeb511b675cb4de22a62016f9
parent 378026 96478f8a59130cae33d0b332fdb88b0fc8307619
child 378028 40425a7cb3569597c1277203c8c2d0109bb78468
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1334047
milestone53.0a2
backs oute72aaa3b621e51a2563cf72335813b1a05bd7c23
Backed out changeset e72aaa3b621e (bug 1334047) for bustage
dom/base/nsDocument.cpp
--- a/dom/base/nsDocument.cpp
+++ b/dom/base/nsDocument.cpp
@@ -4394,18 +4394,23 @@ nsDocument::SetScopeObject(nsIGlobalObje
     nsCOMPtr<nsPIDOMWindowInner> window = do_QueryInterface(aGlobal);
     if (window) {
       // We want to get the tabgroup unconditionally, such that we can make
       // certain that it is cached in the inner window early enough.
       mozilla::dom::TabGroup* tabgroup = window->TabGroup();
       // We should already have the principal, and now that we have been added to a
       // window, we should be able to join a DocGroup!
       nsAutoCString docGroupKey;
-      mozilla::dom::DocGroup::GetKey(NodePrincipal(), docGroupKey);
-      if (!mDocGroup) {
+      nsresult rv =
+        mozilla::dom::DocGroup::GetKey(NodePrincipal(), docGroupKey);
+      if (mDocGroup) {
+        if (NS_SUCCEEDED(rv)) {
+          MOZ_RELEASE_ASSERT(mDocGroup->MatchesKey(docGroupKey));
+        }
+      } else {
         mDocGroup = tabgroup->AddDocument(docGroupKey, this);
         MOZ_ASSERT(mDocGroup);
       }
     }
   }
 }
 
 static void