Bug 1275434 - Notify "push-subscription-modified" observers in the child. r=dragana
authorKit Cambridge <kcambridge@mozilla.com>
Sat, 14 May 2016 16:54:51 -0700
changeset 341048 80fbbee5de1fb2616014704c01b0752c2bd2f963
parent 341047 23080ad39e3051ab76f181e7e3cb32875e87bd17
child 341049 332caaad198f1c9789a98408af76c6df9957bde3
push id1183
push userraliiev@mozilla.com
push dateMon, 05 Sep 2016 20:01:49 +0000
treeherdermozilla-release@3148731bed45 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana
bugs1275434
milestone49.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 1275434 - Notify "push-subscription-modified" observers in the child. r=dragana MozReview-Commit-ID: H3DGrhEm3fn
dom/ipc/ContentChild.cpp
dom/ipc/ContentChild.h
dom/ipc/PContent.ipdl
dom/push/PushNotifier.cpp
--- a/dom/ipc/ContentChild.cpp
+++ b/dom/ipc/ContentChild.cpp
@@ -3321,10 +3321,21 @@ ContentChild::RecvPushError(const nsCStr
 {
 #ifndef MOZ_SIMPLEPUSH
   PushErrorDispatcher dispatcher(aScope, aPrincipal, aMessage, aFlags);
   Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObserversAndWorkers()));
 #endif
   return true;
 }
 
+bool
+ContentChild::RecvNotifyPushSubscriptionModifiedObservers(const nsCString& aScope,
+                                                          const IPC::Principal& aPrincipal)
+{
+#ifndef MOZ_SIMPLEPUSH
+  PushSubscriptionModifiedDispatcher dispatcher(aScope, aPrincipal);
+  Unused << NS_WARN_IF(NS_FAILED(dispatcher.NotifyObservers()));
+#endif
+  return true;
+}
+
 } // namespace dom
 } // namespace mozilla
--- a/dom/ipc/ContentChild.h
+++ b/dom/ipc/ContentChild.h
@@ -537,16 +537,20 @@ public:
   virtual bool
   RecvPushSubscriptionChange(const nsCString& aScope,
                              const IPC::Principal& aPrincipal) override;
 
   virtual bool
   RecvPushError(const nsCString& aScope, const IPC::Principal& aPrincipal,
                 const nsString& aMessage, const uint32_t& aFlags) override;
 
+  virtual bool
+  RecvNotifyPushSubscriptionModifiedObservers(const nsCString& aScope,
+                                              const IPC::Principal& aPrincipal) override;
+
   // Get the directory for IndexedDB files. We query the parent for this and
   // cache the value
   nsString &GetIndexedDBPath();
 
   ContentParentId GetID() const { return mID; }
 
   bool IsForApp() const { return mIsForApp; }
   bool IsForBrowser() const { return mIsForBrowser; }
--- a/dom/ipc/PContent.ipdl
+++ b/dom/ipc/PContent.ipdl
@@ -1194,21 +1194,21 @@ parent:
                                       nsString messageId, uint8_t[] data);
 
     /**
      * Notify `push-subscription-change` observers in the parent.
      */
     async NotifyPushSubscriptionChangeObservers(nsCString scope,
                                                 Principal principal);
 
+both:
+     async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
+                        Principal aPrincipal, ClonedMessageData aData);
+
     /**
-     * Notify `push-subscription-modified` observers in the parent.
+     * Notify `push-subscription-modified` observers in the parent and child.
      */
     async NotifyPushSubscriptionModifiedObservers(nsCString scope,
                                                   Principal principal);
-
-both:
-     async AsyncMessage(nsString aMessage, CpowEntry[] aCpows,
-                        Principal aPrincipal, ClonedMessageData aData);
 };
 
 }
 }
--- a/dom/push/PushNotifier.cpp
+++ b/dom/push/PushNotifier.cpp
@@ -447,19 +447,20 @@ PushSubscriptionModifiedDispatcher::Noti
 bool
 PushSubscriptionModifiedDispatcher::SendToParent(ContentChild* aParentActor)
 {
   return aParentActor->SendNotifyPushSubscriptionModifiedObservers(mScope,
                                                                    IPC::Principal(mPrincipal));
 }
 
 bool
-PushSubscriptionModifiedDispatcher::SendToChild(ContentParent*)
+PushSubscriptionModifiedDispatcher::SendToChild(ContentParent* aContentActor)
 {
-  return true;
+  return aContentActor->SendNotifyPushSubscriptionModifiedObservers(mScope,
+                                                                    IPC::Principal(mPrincipal));
 }
 
 PushErrorDispatcher::PushErrorDispatcher(const nsACString& aScope,
                                          nsIPrincipal* aPrincipal,
                                          const nsAString& aMessage,
                                          uint32_t aFlags)
   : PushDispatcher(aScope, aPrincipal)
   , mMessage(aMessage)