Bug 1170822 - Fix controlled documents comparison. r=catalinb
authorNikhil Marathe <nsm.nikhil@gmail.com>
Tue, 02 Jun 2015 14:53:09 -0700
changeset 248555 c7dd6508cc1cfd756e2626558bd55a185793424a
parent 248554 fd9dcc32adb2889f8937c0b7f3039e36b26a6e64
child 248556 7b49caef100aa96f0ad0506b83c2fd124b3fb8d4
push id28899
push userryanvm@gmail.com
push dateFri, 12 Jun 2015 18:57:39 +0000
treeherdermozilla-central@203e1025a826 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerscatalinb
bugs1170822
milestone41.0a1
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
Bug 1170822 - Fix controlled documents comparison. r=catalinb
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -3687,24 +3687,26 @@ public:
 };
 
 static PLDHashOperator
 EnumControlledDocuments(nsISupports* aKey,
                         ServiceWorkerRegistrationInfo* aRegistration,
                         void* aData)
 {
   FilterRegistrationData* data = static_cast<FilterRegistrationData*>(aData);
-  if (data->mRegistration != aRegistration) {
+  MOZ_ASSERT(data->mRegistration);
+  MOZ_ASSERT(aRegistration);
+  if (!data->mRegistration->mScope.Equals(aRegistration->mScope)) {
     return PL_DHASH_NEXT;
   }
 
   nsCOMPtr<nsIDocument> document = do_QueryInterface(aKey);
 
   if (!document || !document->GetWindow()) {
-      return PL_DHASH_NEXT;
+    return PL_DHASH_NEXT;
   }
 
   ServiceWorkerClientInfo clientInfo(document);
   data->mDocuments.AppendElement(clientInfo);
 
   return PL_DHASH_NEXT;
 }