Bug 1352772 - Send permissions to the content process before dispatching push events, r=catalinb

MozReview-Commit-ID: DVLjumi9iBJ
This commit is contained in:
Michael Layzell 2017-04-04 14:24:36 -04:00
Родитель 5a9e0a94bc
Коммит 3e2ea2116b
2 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -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.

Просмотреть файл

@ -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);