Bug 1383905 - Push notifications should only use "web" content processes. r=bkelly
☠☠ backed out by 506c0fc7d2f2 ☠ ☠
authorAndrew Sutherland <asutherland@asutherland.org>
Mon, 24 Jul 2017 23:28:41 -0400
changeset 419584 c49b7e6e9811851c02017fae4150a3624a84f3fc
parent 419583 75d0af6c7c49e3988d2d24efd602d032d6c63de1
child 419585 53accdb19e4f336d10a3a93a377b25f89f343826
push id7566
push usermtabara@mozilla.com
push dateWed, 02 Aug 2017 08:25:16 +0000
treeherdermozilla-beta@86913f512c3c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbkelly
bugs1383905
milestone56.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 1383905 - Push notifications should only use "web" content processes. r=bkelly This introduces filtering to avoid attempting to dispatch notifications to WebExtensions processes and other types of content processes.
dom/push/PushNotifier.cpp
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -103,16 +103,23 @@ PushNotifier::Dispatch(PushDispatcher& a
     Unused << NS_WARN_IF(NS_FAILED(aDispatcher.NotifyObservers()));
 
     nsTArray<ContentParent*> contentActors;
     ContentParent::GetAll(contentActors);
     if (!contentActors.IsEmpty()) {
       // 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;
+        }
+
         // Ensure that the content actor has the permissions avaliable for the
         // principal the push is being sent for before sending the push message
         // down.
         Unused << contentActors[i]->
           TransmitPermissionsForPrincipal(aDispatcher.GetPrincipal());
         if (aDispatcher.SendToChild(contentActors[i])) {
           // Only send the push message to the first content process to avoid
           // multiple SWs showing the same notification. See bug 1300112.