Use a strongly typed identifier for SWServer::Connection
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Nov 2017 02:27:13 +0000 (02:27 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 18 Nov 2017 02:27:13 +0000 (02:27 +0000)
commitd274987b1b0dcaa846f4787e85e9ec39d649ad3f
tree2523340776787a362d7937ce987b9ffa71837fa4
parent50cdd0701bf03061fc4c8ae9d14cb49513068222
Use a strongly typed identifier for SWServer::Connection
https://bugs.webkit.org/show_bug.cgi?id=179848

Reviewed by Brady Eidson.

Source/WebCore:

Use a strongly typed identifier for SWServer::Connection, for clarity.

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
(WebCore::ServiceWorkerClient::create):
(WebCore::ServiceWorkerClient::identifier const):
* workers/service/ServiceWorkerClientData.cpp:
(WebCore::ServiceWorkerClientData::isolatedCopy const):
(WebCore::ServiceWorkerClientData::from):
* workers/service/ServiceWorkerClientData.h:
(WebCore::ServiceWorkerClientData::encode const):
(WebCore::ServiceWorkerClientData::decode):
* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::toString const):
(WebCore::ServiceWorkerClientIdentifier::decode):
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::removeRegistration):
(WebCore::ServiceWorkerContainer::updateRegistration):
(WebCore::ServiceWorkerContainer::connectionIdentifier):
* workers/service/ServiceWorkerContainer.h:
* workers/service/ServiceWorkerFetchResult.h:
(WebCore::ServiceWorkerFetchResult::decode):
* workers/service/ServiceWorkerJobClient.h:
* workers/service/ServiceWorkerJobData.cpp:
(WebCore::ServiceWorkerJobData::ServiceWorkerJobData):
* workers/service/ServiceWorkerJobData.h:
(WebCore::ServiceWorkerJobData::connectionIdentifier const):
(WebCore::ServiceWorkerJobData::decode):
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerWindowClient.cpp:
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
* workers/service/ServiceWorkerWindowClient.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::Connection::Connection):
(WebCore::SWServer::Connection::scheduleJobInServer):
(WebCore::SWServer::rejectJob):
(WebCore::SWServer::resolveRegistrationJob):
(WebCore::SWServer::startScriptFetch):
(WebCore::SWServer::scriptFetchFinished):
* workers/service/server/SWServer.h:
(WebCore::SWServer::Connection::identifier const):
(WebCore::SWServer::getConnection):
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::forEachConnection):
(WebCore::SWServerRegistration::addClientServiceWorkerRegistration):
(WebCore::SWServerRegistration::removeClientServiceWorkerRegistration):
(WebCore::SWServerRegistration::unregisterServerConnection):
* workers/service/server/SWServerRegistration.h:

Source/WebKit:

Use a strongly typed identifier for SWServer::Connection, for clarity.

* Scripts/webkit/messages.py:
(forward_declarations_and_headers):
(forward_declarations_and_headers.templates):
(headers_for_type):
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::WebSWServerConnection):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::didFailFetch):
(WebKit::StorageProcess::didNotHandleFetch):
(WebKit::StorageProcess::didReceiveFetchResponse):
(WebKit::StorageProcess::didReceiveFetchData):
(WebKit::StorageProcess::didReceiveFetchFormData):
(WebKit::StorageProcess::didFinishFetch):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:
* StorageProcess/StorageToWebProcessConnection.cpp:
(WebKit::StorageToWebProcessConnection::didReceiveMessage):
(WebKit::StorageToWebProcessConnection::establishSWServerConnection):
(WebKit::StorageToWebProcessConnection::removeSWServerConnection):
(WebKit::generateIDBConnectionToServerIdentifier):
(WebKit::StorageToWebProcessConnection::establishIDBConnectionToServer):
* StorageProcess/StorageToWebProcessConnection.h:
* StorageProcess/StorageToWebProcessConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp:
(WebKit::WebServiceWorkerFetchTaskClient::WebServiceWorkerFetchTaskClient):
* WebProcess/Storage/WebServiceWorkerFetchTaskClient.h:
* WebProcess/Storage/WebToStorageProcessConnection.cpp:
(WebKit::WebToStorageProcessConnection::didReceiveMessage):
(WebKit::WebToStorageProcessConnection::serviceWorkerConnectionForSession):
* WebProcess/Storage/WebToStorageProcessConnection.h:

Source/WTF:

Make ObjectIdentifier a little more flexible to support more use cases.

* wtf/ObjectIdentifier.h:
(WTF::ObjectIdentifier::toUInt64 const):
(WTF::makeObjectIdentifier):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225008 268f45cc-cd09-0410-ab3c-d52691b4dbfc
47 files changed:
Source/WTF/ChangeLog
Source/WTF/wtf/ObjectIdentifier.h
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorkerClient.cpp
Source/WebCore/workers/service/ServiceWorkerClient.h
Source/WebCore/workers/service/ServiceWorkerClientData.cpp
Source/WebCore/workers/service/ServiceWorkerClientData.h
Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h
Source/WebCore/workers/service/ServiceWorkerContainer.cpp
Source/WebCore/workers/service/ServiceWorkerContainer.h
Source/WebCore/workers/service/ServiceWorkerFetchResult.h
Source/WebCore/workers/service/ServiceWorkerJobClient.h
Source/WebCore/workers/service/ServiceWorkerJobData.cpp
Source/WebCore/workers/service/ServiceWorkerJobData.h
Source/WebCore/workers/service/ServiceWorkerTypes.h
Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp
Source/WebCore/workers/service/ServiceWorkerWindowClient.h
Source/WebCore/workers/service/context/SWContextManager.cpp
Source/WebCore/workers/service/context/SWContextManager.h
Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
Source/WebCore/workers/service/context/ServiceWorkerThread.h
Source/WebCore/workers/service/server/SWClientConnection.h
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebCore/workers/service/server/SWServerRegistration.cpp
Source/WebCore/workers/service/server/SWServerRegistration.h
Source/WebKit/ChangeLog
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in
Source/WebKit/StorageProcess/StorageProcess.cpp
Source/WebKit/StorageProcess/StorageProcess.h
Source/WebKit/StorageProcess/StorageProcess.messages.in
Source/WebKit/StorageProcess/StorageToWebProcessConnection.cpp
Source/WebKit/StorageProcess/StorageToWebProcessConnection.h
Source/WebKit/StorageProcess/StorageToWebProcessConnection.messages.in
Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWClientConnection.h
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in
Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.cpp
Source/WebKit/WebProcess/Storage/WebServiceWorkerFetchTaskClient.h
Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.cpp
Source/WebKit/WebProcess/Storage/WebToStorageProcessConnection.h