From 3e2ea2116b59e6dcc4d73ddce4713b714c0ed15e Mon Sep 17 00:00:00 2001 From: Michael Layzell Date: Tue, 4 Apr 2017 14:24:36 -0400 Subject: [PATCH] Bug 1352772 - Send permissions to the content process before dispatching push events, r=catalinb MozReview-Commit-ID: DVLjumi9iBJ --- dom/push/PushNotifier.cpp | 5 +++++ dom/push/PushNotifier.h | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/dom/push/PushNotifier.cpp b/dom/push/PushNotifier.cpp index 181b79c7869a..f0949fbb7588 100644 --- a/dom/push/PushNotifier.cpp +++ b/dom/push/PushNotifier.cpp @@ -108,6 +108,11 @@ PushNotifier::Dispatch(PushDispatcher& aDispatcher) // 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) { + // 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. diff --git a/dom/push/PushNotifier.h b/dom/push/PushNotifier.h index 878e601dfce7..afc80cff0f4d 100644 --- a/dom/push/PushNotifier.h +++ b/dom/push/PushNotifier.h @@ -51,6 +51,10 @@ public: // are no active content processes. The default behavior is a no-op. virtual nsresult HandleNoChildProcesses(); + nsIPrincipal* GetPrincipal() { + return mPrincipal; + } + protected: PushDispatcher(const nsACString& aScope, nsIPrincipal* aPrincipal);