Bug 1202085 - Part 3: Relax the assertion in ServiceWorkerManager::IsControlled to only happen when we think the document is controlled; r=jdm a=ritu
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 27 Oct 2015 14:10:39 -0400
changeset 305449 8802cf4e9ecf5090fc295efb6543974aae4714cb
parent 305448 a00212c1f5ca7f5cfa4c36a4baba391e84747678
child 305450 5289a341cf53fb6779e1ca57f8fad7e56efb5635
push id1001
push userraliiev@mozilla.com
push dateMon, 18 Jan 2016 19:06:03 +0000
treeherdermozilla-release@8b89261f3ac4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm, ritu
bugs1202085
milestone44.0a2
Bug 1202085 - Part 3: Relax the assertion in ServiceWorkerManager::IsControlled to only happen when we think the document is controlled; r=jdm a=ritu
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -3133,26 +3133,26 @@ ServiceWorkerManager::IsAvailable(const 
     GetServiceWorkerRegistrationInfo(aOriginAttributes, aURI);
   return registration && registration->mActiveWorker;
 }
 
 bool
 ServiceWorkerManager::IsControlled(nsIDocument* aDoc, ErrorResult& aRv)
 {
   MOZ_ASSERT(aDoc);
-  MOZ_ASSERT(!nsContentUtils::IsInPrivateBrowsing(aDoc));
 
   RefPtr<ServiceWorkerRegistrationInfo> registration;
   nsresult rv = GetDocumentRegistration(aDoc, getter_AddRefs(registration));
   if (NS_WARN_IF(NS_FAILED(rv) && rv != NS_ERROR_NOT_AVAILABLE)) {
     // It's OK to ignore the case where we don't have a registration.
     aRv.Throw(rv);
     return false;
   }
 
+  MOZ_ASSERT_IF(!!registration, !nsContentUtils::IsInPrivateBrowsing(aDoc));
   return !!registration;
 }
 
 nsresult
 ServiceWorkerManager::GetDocumentRegistration(nsIDocument* aDoc,
                                               ServiceWorkerRegistrationInfo** aRegistrationInfo)
 {
   RefPtr<ServiceWorkerRegistrationInfo> registration;