Implement better support for "Clear" algorithm.
Created attachment 326389 [details] WIP Patch
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
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
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
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
Created attachment 326619 [details] WIP Patch
Created attachment 326620 [details] WIP Patch
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
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
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
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
Created attachment 326632 [details] Patch
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
Created attachment 326640 [details] Patch
Comment on attachment 326640 [details] Patch Much better!
Comment on attachment 326640 [details] Patch Clearing flags on attachment: 326640 Committed r224710: <https://trac.webkit.org/changeset/224710>
All reviewed patches have been landed. Closing bug.
<rdar://problem/35562229>