Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Allow Service Workers to run for a little longer in case of functiona…
…l events https://bugs.webkit.org/show_bug.cgi?id=240454 Patch by Youenn Fablet <youennf@gmail.com> on 2022-05-17 Reviewed by Chris Dumez. Functional events should usually trigger opening a new web page on the same origin as the service worker. There are good chances that the service worker will control the new web page, it is thus potentially useful to keep the service worker around for a bit, to not pay the cost of stopping and restarting it. To do so, we introduce a timer in SWServerWorker that handles the termination in case of functional events/debugger. Covered by updated API test. * Tools/TestWebKitAPI/Tests/WebKitCocoa/PushAPI.mm: * Source/WebCore/workers/service/server/SWServerWorker.cpp: (WebCore::SWServerWorker::startTermination): (WebCore::SWServerWorker::shouldBeTerminated const): (WebCore::SWServerWorker::terminateIfPossible): (WebCore::SWServerWorker::terminationIfPossibleTimerFired): * Source/WebCore/workers/service/server/SWServerWorker.h: Canonical link: https://commits.webkit.org/250635@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@294315 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
074ea00
commit ff2e4e4e8cb42ef46e35ac2e45a86f6143cd0a20
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters