Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 18:08:53 +0000 (18:08 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Dec 2017 18:08:53 +0000 (18:08 +0000)
commit5c0b93555f54a6d316bf85b1bdaacb466f723bc8
tree0ad511860895ccaed4bc7a77077a5ad66d5e3143
parent486a34824f99b27bc7845c94b5f7e73c2c8a2f00
Simplify IPC code between WebProcess and StorageProcess for serviceWorker.postMessage()
https://bugs.webkit.org/show_bug.cgi?id=180683

Reviewed by Brady Eidson.

Merge the 2 code paths from calling postMessage() from a ServiceWorkerClient and from
a ServiceWorker. Also, postMessage() now only IPCs an identifier from the WebContent
process to the StorageProcess. The ServiceWorkerClientData is looked up on Storage
process side from the identifier before being sent to the context process.

Source/WebCore:

* workers/service/SWClientConnection.h:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerTypes.h:
* workers/service/server/SWServer.cpp:
(WebCore::SWServer::clientByID const):
(WebCore::SWServer::matchAll):
(WebCore::SWServer::forEachClientForOrigin):
(WebCore::SWServer::claim):
(WebCore::SWServer::registerServiceWorkerClient):
(WebCore::SWServer::unregisterServiceWorkerClient):
* workers/service/server/SWServer.h:
* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::findClientByIdentifier):
* workers/service/server/SWServerWorker.h:

Source/WebKit:

* Scripts/webkit/messages.py:
(forward_declarations_and_headers):
(headers_for_type):
* Shared/WebCoreArgumentCoders.cpp:
(IPC::ArgumentCoder<ServiceWorkerOrClientIdentifier>::encode):
(IPC::ArgumentCoder<ServiceWorkerOrClientIdentifier>::decode):
* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
* WebProcess/Storage/WebSWClientConnection.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225787 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/workers/service/SWClientConnection.h
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorkerTypes.h
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServer.h
Source/WebCore/workers/service/server/SWServerWorker.cpp
Source/WebCore/workers/service/server/SWServerWorker.h
Source/WebKit/ChangeLog
Source/WebKit/Scripts/webkit/messages.py
Source/WebKit/Shared/WebCoreArgumentCoders.cpp
Source/WebKit/Shared/WebCoreArgumentCoders.h
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.h
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.messages.in
Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWClientConnection.h