[Service Workers] Drop support for registration resurrection
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Sep 2019 05:42:51 +0000 (05:42 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 8 Sep 2019 05:42:51 +0000 (05:42 +0000)
commit2ed2de19d7601d05531e651d010e30c644ae2d7d
treeb48c6fb6714f97f6c32cd4f6f075223e56d85909
parentf9d651cb5768fc9ba125cf65c1c5e139eb8c6e85
[Service Workers] Drop support for registration resurrection
https://bugs.webkit.org/show_bug.cgi?id=201584

Reviewed by Alex Christensen.

LayoutTests/imported/w3c:

Re-sync a couple of outdated WPT tests from upstream 820f0f86047e6e.

* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https.html:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt:
* web-platform-tests/service-workers/service-worker/unregister-then-register.https.html:

Source/WebCore:

Drop support for registration resurrection (Unregistering then quickly re-registering would resurrect
the original registration instead of creating a new one). This behavior is no longer in the
specification (No more "isUninstalling" flag on the registration, and the registration is removed
from the "scope to registration map" right away upon unregistering).

This resurrection behavior was causing a lot of flakiness in the tests so it is likely we will be able
to unskip some tests. This is also what was causing the flakiness that caused Bug 201169 to be rolled
out.

No new tests, updated existing tests.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::activeWorkerFromRegistrationID):
(WebCore::SWServer::getRegistration):
(WebCore::SWServer::addRegistration):
(WebCore::SWServer::removeRegistration):
(WebCore::SWServer::getRegistrations):
(WebCore::SWServer::clearAll):
(WebCore::SWServer::clear):
(WebCore::SWServer::terminatePreinstallationWorker):
(WebCore::SWServer::didFinishActivation):
(WebCore::SWServer::claim):
(WebCore::SWServer::addClientServiceWorkerRegistration):
(WebCore::SWServer::removeClientServiceWorkerRegistration):
(WebCore::SWServer::installContextData):
(WebCore::SWServer::runServiceWorker):
(WebCore::SWServer::doRegistrationMatching):
(WebCore::SWServer::registrationFromServiceWorkerIdentifier):
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
(WebCore::SWServer::removeFromScopeToRegistrationMap):
(WebCore::SWServer::performGetOriginsWithRegistrationsCallbacks):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerJobQueue.cpp:
(WebCore::SWServerJobQueue::runRegisterJob):
(WebCore::SWServerJobQueue::runUnregisterJob):
(WebCore::SWServerJobQueue::runUpdateJob):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::clear):
(WebCore::SWServerRegistration::handleClientUnload):
(WebCore::SWServerRegistration::isUnregistered const):
* workers/service/server/SWServerRegistration.h:
(WebCore::SWServerRegistration::scopeURLWithoutFragment const):
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::SWServerWorker):
(WebCore::m_scriptResourceMap):
(WebCore::SWServerWorker::contextData const):
(WebCore::SWServerWorker::skipWaiting):
(WebCore::SWServerWorker::setHasPendingEvents):
(WebCore::SWServerWorker::setState):
(WebCore::SWServerWorker::registration const):
* workers/service/server/SWServerWorker.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@249627 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/http/tests/workers/service/basic-unregister-then-register-again-reuse-expected.txt
LayoutTests/http/tests/workers/service/basic-unregister-then-register-again-reuse.html
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register-new-script.https.html
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/unregister-then-register.https.html
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebCore/workers/service/server/SWServerJobQueue.cpp
Source/WebCore/workers/service/server/SWServerRegistration.cpp
Source/WebCore/workers/service/server/SWServerRegistration.h
Source/WebCore/workers/service/server/SWServerWorker.cpp
Source/WebCore/workers/service/server/SWServerWorker.h