gecko-dev/dom/serviceworkers
Jens Stutte 87de42e070 Bug 1726813: Ensure AppShutdown remains in sync with shutdown notifications in the parent process. r=xpcom-reviewers,nika,dom-worker-reviewers,asuth
The goal here is to ensure we can always rely on `AppShutdown::GetShutdownPhase` to be in sync with the "real" application status, mainly this was needed for xpcshell tests to not break if we add assertions on our shutdown state on some global singletons.

We keep the existing observer notification topics but force them (on the parent process) to be issued through the new `advanceShutdownPhase` function of the startup service using the `ShutdownPhase` enum. This way we can synchronize `AppShutdown`'s internal status accordingly.

Some further notes:

  # The `MOZ_ASSERT(AppShutdown::IsNoOrLegalShutdownTopic(aTopic));` in `NotifyObservers` helped a lot to identify missing cases. I think we should keep it in order to stay safe.
  # Introducing the `cenum IDLShutdownPhase` helps to keep the knowledge about the mapping from shutdown phases to observer topics exclusively inside AppShutdown.cpp. Still callers must know what they do in order to choose a proper phase, of course.
  # However we must be aware that `AppShutdown` this way can be kept in sync with the shutdown notifications only in the parent process and that `GetCurrentShutdownPhase` might not give the correct result in child processes. We might want to file a follow up bug that adds some asserts to avoid improper use of `AppShutdown` functions in child processes (but I do not want to make this patch bigger as needed to solve the blocking dependency for bug 1697972).
  # The socket process is one example of a child process that "overloads" shutdown topics. I was wondering if it is the right call to use the very same topic names here to request shutdown to the socket process or if it should have its own topics. Those topics triggered the assert and thus I had to disable it for child processes, for now.
  # This goes together with the more general approach to define process type specific shutdown phases (and hence mappings to topics) as drafted very roughly in bug 1697745.
  # This patch seemed to trigger a known intermittent more often, thus the change here in `ServiceWorkerManager`.

Differential Revision: https://phabricator.services.mozilla.com/D124350
2021-09-15 07:25:29 +00:00
..
docs Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
test Bug 1721686 - Add test for exposed interfaces on WebAssembly namespace. r=smaug 2021-09-09 16:20:07 +00:00
FetchEventOpChild.cpp Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
FetchEventOpChild.h Bug 1503072 - Add mitigation to bypass SW on navigation fault. r=dom-worker-reviewers,necko-reviewers,valentin,edenchuang 2021-07-12 21:10:26 +00:00
FetchEventOpParent.cpp
FetchEventOpParent.h
FetchEventOpProxyChild.cpp Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
FetchEventOpProxyChild.h
FetchEventOpProxyParent.cpp
FetchEventOpProxyParent.h
IPCNavigationPreloadState.ipdlh Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
IPCServiceWorkerDescriptor.ipdlh
IPCServiceWorkerRegistrationDescriptor.ipdlh
NavigationPreloadManager.cpp Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
NavigationPreloadManager.h Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
PFetchEventOp.ipdl
PFetchEventOpProxy.ipdl
PServiceWorker.ipdl Bug 1720688 - Support extended attribute syntax in protocol declarations, r=mccr8 2021-07-22 02:24:43 +00:00
PServiceWorkerContainer.ipdl Bug 1720688 - Support extended attribute syntax in protocol declarations, r=mccr8 2021-07-22 02:24:43 +00:00
PServiceWorkerManager.ipdl Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
PServiceWorkerRegistration.ipdl Bug 1720688 - Support extended attribute syntax in protocol declarations, r=mccr8 2021-07-22 02:24:43 +00:00
RemoteServiceWorkerContainerImpl.cpp
RemoteServiceWorkerContainerImpl.h
RemoteServiceWorkerImpl.cpp
RemoteServiceWorkerImpl.h
RemoteServiceWorkerRegistrationImpl.cpp Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
RemoteServiceWorkerRegistrationImpl.h Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorker.cpp Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorker.h
ServiceWorkerActors.cpp
ServiceWorkerActors.h
ServiceWorkerChild.cpp
ServiceWorkerChild.h
ServiceWorkerCloneData.cpp
ServiceWorkerCloneData.h
ServiceWorkerContainer.cpp Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorkerContainer.h
ServiceWorkerContainerChild.cpp
ServiceWorkerContainerChild.h
ServiceWorkerContainerParent.cpp
ServiceWorkerContainerParent.h
ServiceWorkerContainerProxy.cpp
ServiceWorkerContainerProxy.h
ServiceWorkerDescriptor.cpp
ServiceWorkerDescriptor.h
ServiceWorkerEvents.cpp Bug 1693074 - Remove child interception telemetries related codes. r=dom-worker-reviewers,asuth 2021-08-22 11:02:17 +00:00
ServiceWorkerEvents.h
ServiceWorkerIPCUtils.h
ServiceWorkerInfo.cpp Bug 1503072 - Navigation fault interception test support. r=dom-worker-reviewers,edenchuang 2021-07-12 21:10:26 +00:00
ServiceWorkerInfo.h Bug 1503072 - Navigation fault interception test support. r=dom-worker-reviewers,edenchuang 2021-07-12 21:10:26 +00:00
ServiceWorkerInterceptController.cpp Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorkerInterceptController.h
ServiceWorkerJob.cpp
ServiceWorkerJob.h
ServiceWorkerJobQueue.cpp
ServiceWorkerJobQueue.h
ServiceWorkerManager.cpp Bug 1726813: Ensure AppShutdown remains in sync with shutdown notifications in the parent process. r=xpcom-reviewers,nika,dom-worker-reviewers,asuth 2021-09-15 07:25:29 +00:00
ServiceWorkerManager.h Bug 1722502 - P2 Provide quota check finishing notification mechanism in ServiceWorker for testing. r=dom-worker-reviewers,asuth 2021-08-30 09:24:32 +00:00
ServiceWorkerManagerChild.h Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorkerManagerParent.cpp Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorkerManagerParent.h Bug 1496997 - Remove a chunk of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg 2021-06-08 21:02:54 +00:00
ServiceWorkerOp.cpp Bug 1727374 - Root Init dictionaries to fix rooting hazards. r=peterv 2021-09-02 19:06:58 +00:00
ServiceWorkerOp.h Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
ServiceWorkerOpArgs.ipdlh Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
ServiceWorkerOpPromise.h Bug 1693074 - Adding telemetry for evaluating the duration of fetch event dispatching and response synthesizing. r=dom-worker-reviewers,asuth 2021-08-22 11:02:18 +00:00
ServiceWorkerParent.cpp
ServiceWorkerParent.h
ServiceWorkerPrivate.cpp Bug 1727374 - Root Init dictionaries to fix rooting hazards. r=peterv 2021-09-02 19:06:58 +00:00
ServiceWorkerPrivate.h
ServiceWorkerPrivateImpl.cpp Bug 1693074 - Adding telemetry for spawning service worker. r=dom-worker-reviewers,asuth 2021-08-22 11:02:17 +00:00
ServiceWorkerPrivateImpl.h Bug 1693074 - Adding telemetry for spawning service worker. r=dom-worker-reviewers,asuth 2021-08-22 11:02:17 +00:00
ServiceWorkerProxy.cpp
ServiceWorkerProxy.h
ServiceWorkerQuotaUtils.cpp Bug 1722502 - P3 Quota usage mitigation algorithm implementation. r=dom-worker-reviewers,asuth 2021-08-30 09:24:32 +00:00
ServiceWorkerQuotaUtils.h Bug 1722502 - P3 Quota usage mitigation algorithm implementation. r=dom-worker-reviewers,asuth 2021-08-30 09:24:32 +00:00
ServiceWorkerRegisterJob.cpp
ServiceWorkerRegisterJob.h
ServiceWorkerRegistrar.cpp Bug 1725145 - header files fixes in the hybrid build env. r=valentin 2021-08-22 10:21:55 +00:00
ServiceWorkerRegistrar.h Bug 1638099 - Cover with an explicit xpcshell test the expected service worker lifecycle events on addon reload and browser restart. r=asuth,mixedpuppy 2021-07-26 17:52:26 +00:00
ServiceWorkerRegistrarTypes.ipdlh Bug 1564235 - P5 Save NavigationPreload data into serviceworker.txt. r=dom-worker-reviewers,asuth 2021-06-10 06:01:28 +00:00
ServiceWorkerRegistration.cpp Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorkerRegistration.h Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorkerRegistrationChild.cpp
ServiceWorkerRegistrationChild.h
ServiceWorkerRegistrationDescriptor.cpp
ServiceWorkerRegistrationDescriptor.h
ServiceWorkerRegistrationInfo.cpp Bug 1722502 - P1 Implement the quota usage checking methods in ServiceWorker for quota usage mitigation. r=dom-worker-reviewers,asuth 2021-08-30 09:24:31 +00:00
ServiceWorkerRegistrationInfo.h Bug 1722502 - P1 Implement the quota usage checking methods in ServiceWorker for quota usage mitigation. r=dom-worker-reviewers,asuth 2021-08-30 09:24:31 +00:00
ServiceWorkerRegistrationListener.h
ServiceWorkerRegistrationParent.cpp Bug 1564235 - P4 Save NavigationPreload data in ServiceWorkerRegistration Info. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorkerRegistrationParent.h Bug 1564235 - P3 Create IPC for NavigationPreload in PServiceWorkerRegistration.ipdl. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorkerRegistrationProxy.cpp Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug. 2021-09-07 08:01:18 +00:00
ServiceWorkerRegistrationProxy.h Bug 1564235 - P4 Save NavigationPreload data in ServiceWorkerRegistration Info. r=dom-worker-reviewers,asuth 2021-06-10 06:01:27 +00:00
ServiceWorkerScriptCache.cpp Bug 1708448 - Move property and element functions into js/public/PropertyAndElement.h. r=nbp 2021-07-13 11:52:42 +00:00
ServiceWorkerScriptCache.h
ServiceWorkerShutdownBlocker.cpp Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug. 2021-09-07 08:01:18 +00:00
ServiceWorkerShutdownBlocker.h Bug 1728760 - require all nsITimerCallback native implementations to also implement nsINamed, r=smaug. 2021-09-07 08:01:18 +00:00
ServiceWorkerShutdownState.cpp Bug 1496997 - Remove rest of child intercept code from dom/serviceworkers r=asuth,dom-workers-and-storage-reviewers,sg,jdescottes,nchevobbe 2021-06-08 21:02:54 +00:00
ServiceWorkerShutdownState.h
ServiceWorkerUnregisterCallback.cpp
ServiceWorkerUnregisterCallback.h
ServiceWorkerUnregisterJob.cpp
ServiceWorkerUnregisterJob.h
ServiceWorkerUpdateJob.cpp
ServiceWorkerUpdateJob.h
ServiceWorkerUtils.cpp Bug 1496997 - Remove ServiceWorkerParentInterceptEnabled() and callers r=asuth,dom-workers-and-storage-reviewers,necko-reviewers,dragana 2021-06-08 21:02:55 +00:00
ServiceWorkerUtils.h Bug 1723050 - Part 26: Replace typedef by using in dom/serviceworkers/ r=dom-worker-reviewers,edenchuang 2021-08-11 14:41:34 +00:00
moz.build Bug 1722502 - P3 Quota usage mitigation algorithm implementation. r=dom-worker-reviewers,asuth 2021-08-30 09:24:32 +00:00