Bug 179441

Summary: [Service Workers] Implement better support for "Clear Registration" algorithm
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: WebCore Misc.Assignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: beidson, buildbot, commit-queue, ggaren, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
URL: https://w3c.github.io/ServiceWorker/#clear-registration-algorithm
Bug Depends on: 179401, 179436    
Bug Blocks:    
Attachments:
Description Flags
WIP Patch
buildbot: commit-queue-
Archive of layout-test-results from ews105 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews122 for ios-simulator-wk2
none
WIP Patch
none
WIP Patch
none
Archive of layout-test-results from ews104 for mac-elcapitan-wk2
none
Archive of layout-test-results from ews125 for ios-simulator-wk2
none
Patch
none
Patch none

Chris Dumez
Reported 2017-11-08 13:19:07 PST
Implement better support for "Clear" algorithm.
Attachments
WIP Patch (8.27 KB, patch)
2017-11-08 15:05 PST, Chris Dumez
buildbot: commit-queue-
Archive of layout-test-results from ews105 for mac-elcapitan-wk2 (3.98 MB, application/zip)
2017-11-08 17:03 PST, Build Bot
no flags
Archive of layout-test-results from ews122 for ios-simulator-wk2 (2.44 MB, application/zip)
2017-11-08 19:33 PST, Build Bot
no flags
WIP Patch (7.65 KB, patch)
2017-11-10 12:48 PST, Chris Dumez
no flags
WIP Patch (6.27 KB, patch)
2017-11-10 12:48 PST, Chris Dumez
no flags
Archive of layout-test-results from ews104 for mac-elcapitan-wk2 (2.55 MB, application/zip)
2017-11-10 13:56 PST, Build Bot
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.12 MB, application/zip)
2017-11-10 14:11 PST, Build Bot
no flags
Patch (10.05 KB, patch)
2017-11-10 14:29 PST, Chris Dumez
no flags
Patch (8.91 KB, patch)
2017-11-10 15:24 PST, Chris Dumez
no flags
Chris Dumez
Comment 1 2017-11-08 15:05:53 PST
Created attachment 326389 [details] WIP Patch
Build Bot
Comment 2 2017-11-08 17:03:30 PST
Comment on attachment 326389 [details] WIP Patch Attachment 326389 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/5155137 New failing tests: http/tests/workers/service/registration-clear-redundant-worker.html svg/wicd/test-rightsizing-a.xhtml
Build Bot
Comment 3 2017-11-08 17:03:31 PST
Created attachment 326409 [details] Archive of layout-test-results from ews105 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews105 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 4 2017-11-08 19:33:14 PST
Comment on attachment 326389 [details] WIP Patch Attachment 326389 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/5156952 New failing tests: http/tests/workers/service/registration-clear-redundant-worker.html
Build Bot
Comment 5 2017-11-08 19:33:15 PST
Created attachment 326418 [details] Archive of layout-test-results from ews122 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews122 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.6
Chris Dumez
Comment 6 2017-11-10 12:48:03 PST
Created attachment 326619 [details] WIP Patch
Chris Dumez
Comment 7 2017-11-10 12:48:45 PST
Created attachment 326620 [details] WIP Patch
Build Bot
Comment 8 2017-11-10 13:56:04 PST
Comment on attachment 326620 [details] WIP Patch Attachment 326620 [details] did not pass mac-wk2-ews (mac-wk2): Output: http://webkit-queues.webkit.org/results/5181514 New failing tests: http/tests/workers/service/registration-clear-redundant-worker.html
Build Bot
Comment 9 2017-11-10 13:56:06 PST
Created attachment 326625 [details] Archive of layout-test-results from ews104 for mac-elcapitan-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-elcapitan-wk2 Platform: Mac OS X 10.11.6
Build Bot
Comment 10 2017-11-10 14:11:53 PST
Comment on attachment 326620 [details] WIP Patch Attachment 326620 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: http://webkit-queues.webkit.org/results/5181537 New failing tests: http/tests/workers/service/registration-clear-redundant-worker.html
Build Bot
Comment 11 2017-11-10 14:11:54 PST
Created attachment 326629 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.12.6
Chris Dumez
Comment 12 2017-11-10 14:29:25 PST
Brady Eidson
Comment 13 2017-11-10 15:16:22 PST
Comment on attachment 326632 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=326632&action=review > Source/WebCore/workers/service/server/SWServerJobQueue.cpp:364 > + if (auto* installingWorker = registration.installingWorker()) { > + // Terminate registration's installing worker. > + installingWorker->terminate(); > + // Run the Update Worker State algorithm passing registration's installing worker and redundant as the arguments. > + registration.updateWorkerState(*installingWorker, ServiceWorkerState::Redundant); > + // Run the Update Registration State algorithm passing registration, "installing" and null as the arguments. > + registration.updateRegistrationState(ServiceWorkerRegistrationState::Installing, nullptr); > + } > + // If registration's waiting worker is not null, then: > + if (auto* waitingWorker = registration.waitingWorker()) { > + // Terminate registration's waiting worker. > + waitingWorker->terminate(); > + // Run the Update Worker State algorithm passing registration's waiting worker and redundant as the arguments. > + registration.updateWorkerState(*waitingWorker, ServiceWorkerState::Redundant); > + // Run the Update Registration State algorithm passing registration, "waiting" and null as the arguments. > + registration.updateRegistrationState(ServiceWorkerRegistrationState::Waiting, nullptr); > + } > + // If registration's active worker is not null, then: > + if (auto* activeWorker = registration.activeWorker()) { > + // Terminate registration's active worker. > + activeWorker->terminate(); > + // Run the Update Worker State algorithm passing registration's active worker and redundant as the arguments. > + registration.updateWorkerState(*activeWorker, ServiceWorkerState::Redundant); > + // Run the Update Registration State algorithm passing registration, "active" and null as the arguments. > + registration.updateRegistrationState(ServiceWorkerRegistrationState::Active, nullptr); > + } All this code clearly needs to be broken out into a utility function
Chris Dumez
Comment 14 2017-11-10 15:24:28 PST
Brady Eidson
Comment 15 2017-11-10 15:55:31 PST
Comment on attachment 326640 [details] Patch Much better!
Chris Dumez
Comment 16 2017-11-10 16:00:05 PST
Comment on attachment 326640 [details] Patch Clearing flags on attachment: 326640 Committed r224710: <https://trac.webkit.org/changeset/224710>
Chris Dumez
Comment 17 2017-11-10 16:00:07 PST
All reviewed patches have been landed. Closing bug.
Radar WebKit Bug Importer
Comment 18 2017-11-15 09:41:24 PST
Note You need to log in before you can comment on or make changes to this bug.