Bug 1470254 Don't send push events to child process when e10s pref is flipped. r=mrbkap
authorBen Kelly <ben@wanderview.com>
Sat, 23 Jun 2018 10:13:10 -0700
changeset 423449 4ce6cfe17939df34ff3dd7b7a53ba0e2a3b6c90e
parent 423448 c74adc90978c1a2182fc89909499e9d4c3075c1f
child 423450 12df3836b33bb7e31a81fd1919872274f1567639
push id34181
push userbtara@mozilla.com
push dateSun, 24 Jun 2018 09:37:59 +0000
treeherdermozilla-central@d69b7fc884fb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs1470254
milestone62.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 1470254 Don't send push events to child process when e10s pref is flipped. r=mrbkap
dom/push/PushNotifier.cpp
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -98,17 +98,17 @@ nsresult
 PushNotifier::Dispatch(PushDispatcher& aDispatcher)
 {
   if (XRE_IsParentProcess()) {
     // Always notify XPCOM observers in the parent process.
     Unused << NS_WARN_IF(NS_FAILED(aDispatcher.NotifyObservers()));
 
     nsTArray<ContentParent*> contentActors;
     ContentParent::GetAll(contentActors);
-    if (!contentActors.IsEmpty()) {
+    if (!contentActors.IsEmpty() && !ServiceWorkerParentInterceptEnabled()) {
       // At least one content process is active, so e10s must be enabled.
       // Broadcast a message to notify observers and service workers.
       for (uint32_t i = 0; i < contentActors.Length(); ++i) {
         // We need to filter based on process type, only "web" AKA the default
         // remote type is acceptable.
         if (!contentActors[i]->GetRemoteType().EqualsLiteral(
                DEFAULT_REMOTE_TYPE)) {
           continue;
@@ -123,17 +123,17 @@ PushNotifier::Dispatch(PushDispatcher& a
           // Only send the push message to the first content process to avoid
           // multiple SWs showing the same notification. See bug 1300112.
           break;
         }
       }
       return NS_OK;
     }
 
-    if (BrowserTabsRemoteAutostart()) {
+    if (BrowserTabsRemoteAutostart() && !ServiceWorkerParentInterceptEnabled()) {
       // e10s is enabled, but no content processes are active.
       return aDispatcher.HandleNoChildProcesses();
     }
 
     // e10s is disabled; notify workers in the parent.
     return aDispatcher.NotifyWorkers();
   }