Bug 1230030 Don't replace active worker unnecessarly after saving registration in e10s mode. r=ehsan
authorBen Kelly <ben@wanderview.com>
Fri, 08 Jan 2016 11:18:41 -0800
changeset 279151 b82dc4ab197bf8cfba1c6029a2e499d3e019b81a
parent 279150 ababff07ea8e4ab93202b301da21be628e645d88
child 279152 9133117f410c06ad7fa25323a168bc97200043b9
push id69996
push userbkelly@mozilla.com
push dateFri, 08 Jan 2016 19:18:12 +0000
treeherdermozilla-inbound@b82dc4ab197b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersehsan
bugs1230030
milestone46.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 1230030 Don't replace active worker unnecessarly after saving registration in e10s mode. r=ehsan
dom/workers/ServiceWorkerManager.cpp
--- a/dom/workers/ServiceWorkerManager.cpp
+++ b/dom/workers/ServiceWorkerManager.cpp
@@ -2915,18 +2915,20 @@ ServiceWorkerManager::LoadRegistration(
   }
 
   RefPtr<ServiceWorkerRegistrationInfo> registration =
     GetRegistration(principal, aRegistration.scope());
   if (!registration) {
     registration = CreateNewRegistration(aRegistration.scope(), principal);
   } else {
     RefPtr<ServiceWorkerInfo> newest = registration->Newest();
+    // If the script spec matches and our active worker state matches our
+    // expectations for a "current worker", then we are done.
     if (newest && newest->ScriptSpec() == aRegistration.scriptSpec() &&
-        !!registration->mActiveWorker == aRegistration.currentWorkerURL().IsEmpty()) {
+        !registration->mActiveWorker == aRegistration.currentWorkerURL().IsEmpty()) {
       // No needs for updates.
       return;
     }
   }
 
   const nsCString& currentWorkerURL = aRegistration.currentWorkerURL();
   if (!currentWorkerURL.IsEmpty()) {
     registration->mActiveWorker =