Read registrations in from disk.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 01:27:00 +0000 (01:27 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 8 Dec 2017 01:27:00 +0000 (01:27 +0000)
commitcb95147f923060c1b74c32929e601603a82f2869
tree8de8637678eb69c10a2597e0fd69ef39750f881e
parentfe45d79540968f653ddc141d81a71d73da614f38
Read registrations in from disk.
https://bugs.webkit.org/show_bug.cgi?id=180543

Reviewed by Andy Estes.

No new tests (Not testable quite yet)

On launch, read through the database.

Set up enough objects in the SWServer necessary to cause fetches and postMessages to
go to a worker that has never run before.

* workers/service/ServiceWorkerContextData.cpp:
(WebCore::ServiceWorkerContextData::isolatedCopy const):
* workers/service/ServiceWorkerContextData.h:
(WebCore::ServiceWorkerContextData::encode const):
(WebCore::ServiceWorkerContextData::decode):

* workers/service/ServiceWorkerRegistrationKey.cpp:
(WebCore::ServiceWorkerRegistrationKey::toDatabaseKey const):
(WebCore::ServiceWorkerRegistrationKey::fromDatabaseKey):
* workers/service/ServiceWorkerRegistrationKey.h:

* workers/service/server/RegistrationDatabase.cpp:
(WebCore::stringToUpdateViaCache):
(WebCore::stringToWorkerType):
(WebCore::RegistrationDatabase::doPushChanges):
(WebCore::RegistrationDatabase::importRecords):
(WebCore::RegistrationDatabase::addRegistrationToStore):
* workers/service/server/RegistrationDatabase.h:

* workers/service/server/RegistrationStore.cpp:
(WebCore::RegistrationStore::RegistrationStore):
(WebCore::RegistrationStore::addRegistrationFromDatabase):
* workers/service/server/RegistrationStore.h:

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::addRegistrationFromStore):
(WebCore::SWServer::SWServer):
(WebCore::SWServer::updateWorker):
(WebCore::SWServer::tryInstallContextData):
(WebCore::SWServer::installContextData):
(WebCore::generateServiceWorkerIdentifier): Deleted.
* workers/service/server/SWServer.h:

* workers/service/server/SWServerRegistration.h:

* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::contextData const):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225661 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorkerContextData.cpp
Source/WebCore/workers/service/ServiceWorkerContextData.h
Source/WebCore/workers/service/ServiceWorkerRegistrationKey.cpp
Source/WebCore/workers/service/ServiceWorkerRegistrationKey.h
Source/WebCore/workers/service/server/RegistrationDatabase.cpp
Source/WebCore/workers/service/server/RegistrationDatabase.h
Source/WebCore/workers/service/server/RegistrationStore.cpp
Source/WebCore/workers/service/server/RegistrationStore.h
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebCore/workers/service/server/SWServerRegistration.h
Source/WebCore/workers/service/server/SWServerWorker.cpp