gecko-dev/dom/serviceworkers
Perry Jiang 87c3eb5a96 Bug 1575185 - Subscribe content processes spawning Service Workers to permission updates r=asuth
Previously, Service Workers could spawn in a process that isn't subscribed
to permission updates, which could happen if that process hadn't loaded any
same-origin documents. To address this, parent-process logic for spawning
Service Workers would snapshot the permissions state to be sent to a content
process.

Unfortunately, this approach could lead to outdated, unsynchronized permissions.
Note that nsIPermissionManager::SetPermissionsWithKey is only used to initialize
permissions for a given key and is a no-op if already called with the same key
in a given process. As a result, the following sequence of events could happen:

Assume a content process CP that isn't subscribed to permission changes for an
origin A:

1) Parent process decides to spawn an origin A Service Worker in CP,
snapshotting a value V for permission P.
2) The Service Worker is spawned in CP, setting CP's permission manager's
permission P to value V (for origin A).
3) Parent process updates its permission P to a value A', which is not
broadcasted to CP (because it's not subscribed).
4) By now, the initial Service Worker has been terminated, and the parent
process decides once again to spawn an origin A Service Worker in CP.
5) The Service Worker is spawned in CP, but the call to SetPermissionsWithKey
is a no-op, leaving CP1 with a mismatched value for permission P.

An additional scenario is if the parent process updates a permission during a
remote Service Worker's lifetime.

This patch, which would subscribe CP1 to permission updates when the parent
process knows a Service Worker would be spawned in CP1, prevents these problems.

Differential Revision: https://phabricator.services.mozilla.com/D48620

--HG--
extra : moz-landing-system : lando
2019-10-09 02:23:41 +00:00
..
test Backed out 6 changesets (bug 1456995) for devtools failure at browser/browser_aboutdebugging_serviceworker_timeout.js. On a CLOSED TREE 2019-10-05 01:58:08 +03:00
FetchEventOpChild.cpp Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
FetchEventOpChild.h Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
FetchEventOpParent.cpp Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
FetchEventOpParent.h Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
FetchEventOpProxyChild.cpp Bug 1231213 - Implement ServiceWorkerOp and its subclasses. r=asuth 2019-08-15 17:27:08 +00:00
FetchEventOpProxyChild.h Bug 1231213 - Implement ServiceWorkerOp and its subclasses. r=asuth 2019-08-15 17:27:08 +00:00
FetchEventOpProxyParent.cpp Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
FetchEventOpProxyParent.h Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
IPCServiceWorkerDescriptor.ipdlh Bug 1534364 - replace OptionalIPCServiceWorkerDescriptor with IPCServiceWorkerDescriptor? in IPDL: r=valentin 2019-03-15 12:55:10 +00:00
IPCServiceWorkerRegistrationDescriptor.ipdlh Bug 1534364 - replace OptionalIPCServiceWorkerDescriptor with IPCServiceWorkerDescriptor? in IPDL: r=valentin 2019-03-15 12:55:10 +00:00
moz.build Bug 1231213 - Implement ServiceWorkerPrivateImpl to dispatch operations to content processes and respond to their results. r=asuth 2019-08-15 17:27:23 +00:00
PFetchEventOp.ipdl Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
PFetchEventOpProxy.ipdl Bug 1231213 - Implement PFetchEventOp(Proxy) IPDL protocols and FetchEventOp(Proxy){Parent,Child}. r=asuth 2019-08-15 17:27:07 +00:00
PServiceWorker.ipdl
PServiceWorkerContainer.ipdl
PServiceWorkerManager.ipdl
PServiceWorkerRegistration.ipdl
PServiceWorkerUpdater.ipdl
RemoteServiceWorkerContainerImpl.cpp Bug 1559919 - Finish the WorkerHolder cleanup - part 4 - IPCWorkerRef in ServiceWorkerContainerChild, r=asuth 2019-07-12 11:16:15 +00:00
RemoteServiceWorkerContainerImpl.h
RemoteServiceWorkerImpl.cpp Bug 1559919 - Finish the WorkerHolder cleanup - part 6 - IPCWorkerRef in ServiceWorkerChild, r=asuth 2019-07-12 11:16:52 +00:00
RemoteServiceWorkerImpl.h
RemoteServiceWorkerRegistrationImpl.cpp Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
RemoteServiceWorkerRegistrationImpl.h
ServiceWorker.cpp Bug 1563139 - Remove StaticPrefs.h. r=glandium 2019-07-26 01:10:23 +00:00
ServiceWorker.h Bug 1521000 - Part 2: Adjust our clang-format rules to include spaces after the hash for nested preprocessor directives r=sylvestre 2019-01-18 10:16:18 +01:00
ServiceWorkerActors.cpp
ServiceWorkerActors.h
ServiceWorkerChild.cpp Bug 1559919 - Finish the WorkerHolder cleanup - part 6 - IPCWorkerRef in ServiceWorkerChild, r=asuth 2019-07-12 11:16:52 +00:00
ServiceWorkerChild.h Bug 1559919 - Finish the WorkerHolder cleanup - part 6 - IPCWorkerRef in ServiceWorkerChild, r=asuth 2019-07-12 11:16:52 +00:00
ServiceWorkerCloneData.cpp
ServiceWorkerCloneData.h
ServiceWorkerContainer.cpp Bug 1563139 - Remove StaticPrefs.h. r=glandium 2019-07-26 01:10:23 +00:00
ServiceWorkerContainer.h Bug 1517241 - Rename nsIDocument to mozilla::dom::Document. r=smaug 2019-01-03 17:48:33 +01:00
ServiceWorkerContainerChild.cpp Bug 1559919 - Finish the WorkerHolder cleanup - part 4 - IPCWorkerRef in ServiceWorkerContainerChild, r=asuth 2019-07-12 11:16:15 +00:00
ServiceWorkerContainerChild.h Bug 1559919 - Finish the WorkerHolder cleanup - part 4 - IPCWorkerRef in ServiceWorkerContainerChild, r=asuth 2019-07-12 11:16:15 +00:00
ServiceWorkerContainerImpl.cpp Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan 2019-04-05 21:41:42 +00:00
ServiceWorkerContainerImpl.h
ServiceWorkerContainerParent.cpp Bug 1519636 - clang-format-8: Reformat recent changes to the Google coding style r=Ehsan 2019-04-05 21:41:42 +00:00
ServiceWorkerContainerParent.h
ServiceWorkerContainerProxy.cpp
ServiceWorkerContainerProxy.h
ServiceWorkerDescriptor.cpp
ServiceWorkerDescriptor.h
ServiceWorkerEvents.cpp Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug 2019-09-11 14:35:28 +00:00
ServiceWorkerEvents.h Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug 2019-09-11 14:35:28 +00:00
ServiceWorkerImpl.cpp
ServiceWorkerImpl.h
ServiceWorkerInfo.cpp Bug 1552945 - Allow a WorkerPrivate's creator to set its ID. r=asuth 2019-08-20 15:20:40 +00:00
ServiceWorkerInfo.h Bug 1552945 - Allow a WorkerPrivate's creator to set its ID. r=asuth 2019-08-20 15:20:40 +00:00
ServiceWorkerInterceptController.cpp Bug 1560455 - rename CodebasePrincipal to ContentPrincipal. r=ckerschb 2019-07-08 16:37:45 +00:00
ServiceWorkerInterceptController.h
ServiceWorkerIPCUtils.h
ServiceWorkerJob.cpp Bug 1581315 part 3. Add MOZ_MUST_RETURN_FROM_CALLER_IF_THIS_IS_ARG to more ErrorResult methods. r=smaug 2019-09-20 02:19:18 +00:00
ServiceWorkerJob.h
ServiceWorkerJobQueue.cpp
ServiceWorkerJobQueue.h
ServiceWorkerManager.cpp Backed out 6 changesets (bug 1456995) for devtools failure at browser/browser_aboutdebugging_serviceworker_timeout.js. On a CLOSED TREE 2019-10-05 01:58:08 +03:00
ServiceWorkerManager.h Backed out 6 changesets (bug 1456995) for devtools failure at browser/browser_aboutdebugging_serviceworker_timeout.js. On a CLOSED TREE 2019-10-05 01:58:08 +03:00
ServiceWorkerManagerChild.cpp
ServiceWorkerManagerChild.h Bug 1512990 - Part 4 - remove declarations of Recv/Answer methods from IPDL protocol base class; r=froydnj 2019-02-06 15:58:43 +00:00
ServiceWorkerManagerParent.cpp
ServiceWorkerManagerParent.h Bug 1512990 - Part 4 - remove declarations of Recv/Answer methods from IPDL protocol base class; r=froydnj 2019-02-06 15:58:43 +00:00
ServiceWorkerManagerService.cpp Bug 1523969 part 6 - Move method definition inline comments to new line in 'dom/'. r=nika 2019-02-25 16:05:29 -06:00
ServiceWorkerManagerService.h
ServiceWorkerOp.cpp Bug 1578173 part 4. Switch event subclasses to constructor operations. r=smaug 2019-09-11 14:35:28 +00:00
ServiceWorkerOp.h Bug 1231213 - Implement ServiceWorkerOp and its subclasses. r=asuth 2019-08-15 17:27:08 +00:00
ServiceWorkerOpArgs.ipdlh Bug 1231213 - Implement ServiceWorkerOp{Args,Promise,Result}, FetchEventRespondWith{Promise,Result}, and IPCFetchEventRespondWithResult. r=asuth 2019-08-15 17:26:22 +00:00
ServiceWorkerOpPromise.h Bug 1231213 - Implement ServiceWorkerOp{Args,Promise,Result}, FetchEventRespondWith{Promise,Result}, and IPCFetchEventRespondWithResult. r=asuth 2019-08-15 17:26:22 +00:00
ServiceWorkerParent.cpp
ServiceWorkerParent.h
ServiceWorkerPrivate.cpp Bug 1562663 - P3 - Have agent cluster Ids for workers; r=perry,nika 2019-09-23 09:57:23 +00:00
ServiceWorkerPrivate.h Bug 1552945 - Start Service Workers in the parent process with parent-intercept. r=asuth,jdescottes 2019-08-20 15:21:11 +00:00
ServiceWorkerPrivateImpl.cpp Bug 1575185 - Subscribe content processes spawning Service Workers to permission updates r=asuth 2019-10-09 02:23:41 +00:00
ServiceWorkerPrivateImpl.h Bug 1575185 - Subscribe content processes spawning Service Workers to permission updates r=asuth 2019-10-09 02:23:41 +00:00
ServiceWorkerProxy.cpp
ServiceWorkerProxy.h
ServiceWorkerRegisterJob.cpp Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerRegisterJob.h Bug 1527000 - Stop passing a null or empty nsILoadGroup to ServiceWorker CompareNetwork, r=asuth 2019-02-15 04:56:12 +00:00
ServiceWorkerRegistrar.cpp Bug 965637: Move CSP from Principal into Client, part 2: worker changes. r=baku 2019-05-21 23:14:50 +00:00
ServiceWorkerRegistrar.h
ServiceWorkerRegistrarTypes.ipdlh
ServiceWorkerRegistration.cpp Bug 1231213 - Update the update algorithm to better match the spec r=asuth 2019-08-15 17:27:51 +00:00
ServiceWorkerRegistration.h Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerRegistrationChild.cpp Bug 1231213 - Properly declare some dependencies so everything will compile with additional files. r=asuth 2019-08-15 17:25:44 +00:00
ServiceWorkerRegistrationChild.h Bug 1559919 - Finish the WorkerHolder cleanup - part 5 - IPCWorkerRef in ServiceWorkerRegistrationChild, r=asuth 2019-07-12 11:16:34 +00:00
ServiceWorkerRegistrationDescriptor.cpp Bug 1534364 - replace OptionalIPCServiceWorkerDescriptor with IPCServiceWorkerDescriptor? in IPDL: r=valentin 2019-03-15 12:55:10 +00:00
ServiceWorkerRegistrationDescriptor.h Bug 1534364 - replace OptionalIPCServiceWorkerDescriptor with IPCServiceWorkerDescriptor? in IPDL: r=valentin 2019-03-15 12:55:10 +00:00
ServiceWorkerRegistrationImpl.cpp Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerRegistrationImpl.h Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerRegistrationInfo.cpp Bug 1581187 - only shutdown remote Service Workers on browser shutdown r=asuth 2019-10-03 09:58:46 +00:00
ServiceWorkerRegistrationInfo.h Bug 1581187 - only shutdown remote Service Workers on browser shutdown r=asuth 2019-10-03 09:58:46 +00:00
ServiceWorkerRegistrationListener.h Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerRegistrationParent.cpp
ServiceWorkerRegistrationParent.h
ServiceWorkerRegistrationProxy.cpp Bug 1231213 - Allow the delayed ServiceWorkerRegistration.update() mechanism to handle multiple simultaneous requests without timing out. r=asuth 2019-08-15 17:27:44 +00:00
ServiceWorkerRegistrationProxy.h Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerScriptCache.cpp Bug 1565688. Remove unused IOService arg from NS_NewURI. r=mayhemer 2019-07-15 13:39:51 +00:00
ServiceWorkerScriptCache.h Bug 1531263 - Wrong prototype for Compare() function in ServiceWorkerScriptCache, r=asuth 2019-02-28 18:57:46 +00:00
ServiceWorkerShutdownBlocker.cpp Bug 1231213 - Implement ServiceWorkerShutdownBlocker. r=asuth 2019-08-15 17:26:29 +00:00
ServiceWorkerShutdownBlocker.h Bug 1231213 - Implement ServiceWorkerShutdownBlocker. r=asuth 2019-08-15 17:26:29 +00:00
ServiceWorkerUnregisterCallback.cpp
ServiceWorkerUnregisterCallback.h
ServiceWorkerUnregisterJob.cpp Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerUnregisterJob.h
ServiceWorkerUpdateJob.cpp Bug 1557244 - Disallow resurrection of unregistered ServiceWorkerRegistrations r=asuth 2019-07-26 18:41:48 +00:00
ServiceWorkerUpdateJob.h Bug 1527000 - Stop passing a null or empty nsILoadGroup to ServiceWorker CompareNetwork, r=asuth 2019-02-15 04:56:12 +00:00
ServiceWorkerUpdaterChild.cpp
ServiceWorkerUpdaterChild.h
ServiceWorkerUpdaterParent.cpp
ServiceWorkerUpdaterParent.h
ServiceWorkerUtils.cpp Backed out 2 changesets (bug 1558915) for causing bustages. CLOSED TREE 2019-08-02 12:17:42 +03:00
ServiceWorkerUtils.h