Consider calling "Terminate Service Worker" when WebProcesses go away
Rename for the simplicity of this patch: Consider calling "Terminate Service Worker" on all workers when all WebProcesses go away
Created attachment 328272 [details] Patch
Comment on attachment 328272 [details] Patch Clearing flags on attachment: 328272 Committed r225486: <https://trac.webkit.org/changeset/225486>
All reviewed patches have been landed. Closing bug.
<rdar://problem/35836323>
Comment on attachment 328272 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328272&action=review > Source/WebCore/workers/service/server/SWServer.cpp:55 > +static Seconds terminationDelay { 60_s }; I think we can make this value a lot smaller. Starting a worker is less expensive than loading one or more webpages. So, if the user unloads the last page from a given origin, we really aren't that concerned about having to restart the origin's worker later. I'd suggest something like 5s.
(In reply to Geoffrey Garen from comment #6) > Comment on attachment 328272 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=328272&action=review > > > Source/WebCore/workers/service/server/SWServer.cpp:55 > > +static Seconds terminationDelay { 60_s }; > > I think we can make this value a lot smaller. > > Starting a worker is less expensive than loading one or more webpages. So, > if the user unloads the last page from a given origin, we really aren't that > concerned about having to restart the origin's worker later. > > I'd suggest something like 5s. Maybe 60 is too big indeed, especially if we add another timer to quit the service worker process when there is no longer any running service worker. That said, we might need some measurements on how much time it will take for a service worker to run and be ready to process fetch events as this may impact page load time.
Reopening to attach new patch.
Created attachment 328474 [details] Patch
(In reply to youenn fablet from comment #9) > Created attachment 328474 [details] > Patch Reducing from 60_s to 10_s for now.
Comment on attachment 328474 [details] Patch Clearing flags on attachment: 328474 Committed r225533: <https://trac.webkit.org/changeset/225533>