Loading devtools/server/actors/worker.js +12 −0 Original line number Diff line number Diff line Loading @@ -355,6 +355,18 @@ protocol.ActorClassWithSpec(serviceWorkerRegistrationSpec, { "resource://devtools/server/service-worker-child.js", true); _serviceWorkerProcessScriptLoaded = true; } // XXX: Send the permissions down to the content process before starting // the service worker within the content process. As we don't know what // content process we're starting the service worker in (as we're using a // broadcast channel to talk to it), we just broadcast the permissions to // everyone as well. // // This call should be replaced with a proper implementation when // ServiceWorker debugging is improved to support multiple content processes // correctly. Services.perms.broadcastPermissionsForPrincipalToAllContentProcesses(this._registration.principal); Services.ppmm.broadcastAsyncMessage("serviceWorkerRegistration:start", { scope: this._registration.scope }); Loading extensions/cookie/nsPermissionManager.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -3089,3 +3089,16 @@ nsPermissionManager::GetAllKeysForPrincipal(nsIPrincipal* aPrincipal) "Every principal should have at least one key."); return keys; } NS_IMETHODIMP nsPermissionManager::BroadcastPermissionsForPrincipalToAllContentProcesses(nsIPrincipal* aPrincipal) { nsTArray<ContentParent*> cps; ContentParent::GetAll(cps); for (ContentParent* cp : cps) { nsresult rv = cp->TransmitPermissionsForPrincipal(aPrincipal); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; } netwerk/base/nsIPermissionManager.idl +11 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,17 @@ interface nsIPermissionManager : nsISupports * @param perms An array with the permissions which match the given key. */ void setPermissionsWithKey(in ACString permissionKey, in IPCPermissionArrayRef perms); /** * Broadcasts permissions for the given principal to all content processes. * * DO NOT USE THIS METHOD if you can avoid it. It was added in bug XXX to * handle the current temporary implementation of ServiceWorker debugging. It * will be removed when service worker debugging is fixed. * * @param aPrincipal The principal to broadcast permissions for. */ void broadcastPermissionsForPrincipalToAllContentProcesses(in nsIPrincipal aPrincipal); }; %{ C++ Loading Loading
devtools/server/actors/worker.js +12 −0 Original line number Diff line number Diff line Loading @@ -355,6 +355,18 @@ protocol.ActorClassWithSpec(serviceWorkerRegistrationSpec, { "resource://devtools/server/service-worker-child.js", true); _serviceWorkerProcessScriptLoaded = true; } // XXX: Send the permissions down to the content process before starting // the service worker within the content process. As we don't know what // content process we're starting the service worker in (as we're using a // broadcast channel to talk to it), we just broadcast the permissions to // everyone as well. // // This call should be replaced with a proper implementation when // ServiceWorker debugging is improved to support multiple content processes // correctly. Services.perms.broadcastPermissionsForPrincipalToAllContentProcesses(this._registration.principal); Services.ppmm.broadcastAsyncMessage("serviceWorkerRegistration:start", { scope: this._registration.scope }); Loading
extensions/cookie/nsPermissionManager.cpp +13 −0 Original line number Diff line number Diff line Loading @@ -3089,3 +3089,16 @@ nsPermissionManager::GetAllKeysForPrincipal(nsIPrincipal* aPrincipal) "Every principal should have at least one key."); return keys; } NS_IMETHODIMP nsPermissionManager::BroadcastPermissionsForPrincipalToAllContentProcesses(nsIPrincipal* aPrincipal) { nsTArray<ContentParent*> cps; ContentParent::GetAll(cps); for (ContentParent* cp : cps) { nsresult rv = cp->TransmitPermissionsForPrincipal(aPrincipal); NS_ENSURE_SUCCESS(rv, rv); } return NS_OK; }
netwerk/base/nsIPermissionManager.idl +11 −0 Original line number Diff line number Diff line Loading @@ -315,6 +315,17 @@ interface nsIPermissionManager : nsISupports * @param perms An array with the permissions which match the given key. */ void setPermissionsWithKey(in ACString permissionKey, in IPCPermissionArrayRef perms); /** * Broadcasts permissions for the given principal to all content processes. * * DO NOT USE THIS METHOD if you can avoid it. It was added in bug XXX to * handle the current temporary implementation of ServiceWorker debugging. It * will be removed when service worker debugging is fixed. * * @param aPrincipal The principal to broadcast permissions for. */ void broadcastPermissionsForPrincipalToAllContentProcesses(in nsIPrincipal aPrincipal); }; %{ C++ Loading