Bug 1265795 P3 Assert that controlled documents have an outer window. r=bz a=ritu
authorBen Kelly <ben@wanderview.com>
Wed, 04 May 2016 14:18:39 -0700
changeset 326146 d7d52a3b03f4df5f575078ba7f148f494ff8b5d1
parent 326145 03c07da147aa3a1eedf9eb0d03d83a52e067d44b
child 326147 31722794d6c27ce13ad1ced6d1dd9008659f741c
push id1128
push userjlund@mozilla.com
push dateWed, 01 Jun 2016 01:31:59 +0000
treeherdermozilla-release@fe0d30de989d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz, ritu
bugs1265795
milestone47.0
Bug 1265795 P3 Assert that controlled documents have an outer window. r=bz a=ritu
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -4126,16 +4126,20 @@ ServiceWorkerManager::GetAllClients(nsIP
     for (auto iter = mControlledDocuments.Iter(); !iter.Done(); iter.Next()) {
       ServiceWorkerRegistrationInfo* thisRegistration = iter.UserData();
       MOZ_ASSERT(thisRegistration);
       if (!registration->mScope.Equals(thisRegistration->mScope)) {
         continue;
       }
 
       nsCOMPtr<nsIDocument> doc = do_QueryInterface(iter.Key());
+
+      // All controlled documents must have an outer window.
+      MOZ_ASSERT(doc->GetWindow());
+
       ProcessDocument(aPrincipal, doc);
     }
   }
 }
 
 void
 ServiceWorkerManager::MaybeClaimClient(nsIDocument* aDocument,
                                        ServiceWorkerRegistrationInfo* aWorkerRegistration)