Allow passing MessagePorts across processes (e.g. ServiceWorkers).
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 19:24:23 +0000 (19:24 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 23 Jan 2018 19:24:23 +0000 (19:24 +0000)
commitc806c93dcd949ffe5a1f52eab1e07a8903ccb6dd
tree0afc4cc5e6b80b5b7203c35d6fd12e86c3c63054
parente1e3ef43465a6b442207f89391698bad08a3f0e5
Allow passing MessagePorts across processes (e.g. ServiceWorkers).
https://bugs.webkit.org/show_bug.cgi?id=181178

Reviewed by Andy Estes.

LayoutTests/imported/w3c:

Re-baseline for many new passes and a few new failure modes.

* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/postmessage.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt:
* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-fetch.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-not-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-using-registration.https-expected.txt:
* web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt:
* web-platform-tests/service-workers/service-worker/client-id.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-get-cross-origin.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-get.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall-order.https-expected.txt:
* web-platform-tests/service-workers/service-worker/clients-matchall.https-expected.txt:
* web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-respond-with-stops-propagation.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-event-throws-after-respond-with.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-css-images.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https-expected.txt:
* web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt:
* web-platform-tests/service-workers/service-worker/immutable-prototype-serviceworker.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-end-to-end.https-expected.txt:
* web-platform-tests/service-workers/service-worker/registration-events.https-expected.txt:
* web-platform-tests/service-workers/service-worker/skip-waiting-installed.https-expected.txt:

Source/WebCore:

Test: http/tests/workers/service/basic-messageport.html

* dom/MessagePort.cpp:
(WebCore::MessagePort::MessagePort):
(WebCore::MessagePort::~MessagePort):

* dom/messageports/MessagePortChannel.cpp:
(WebCore::MessagePortChannel::entanglePortWithProcess):
* dom/messageports/MessagePortChannel.h:

* workers/service/SWClientConnection.cpp:
(WebCore::SWClientConnection::postMessageToServiceWorkerClient):
* workers/service/SWClientConnection.h:

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):

* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::postMessage):

* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorker):
* workers/service/context/SWContextManager.h:

Source/WebKit:

* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorker):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerClient):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:

* StorageProcess/StorageProcess.cpp:
(WebKit::StorageProcess::postMessageToServiceWorkerClient):
* StorageProcess/StorageProcess.h:
* StorageProcess/StorageProcess.messages.in:

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
(WebKit::WebProcessProxy::postMessageToRemote):

* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorker):
(WebKit::WebSWClientConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWClientConnection.messages.in:

* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorker):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerClient):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

LayoutTests:

* http/tests/workers/service/basic-messageport-expected.txt: Added.
* http/tests/workers/service/basic-messageport.html: Added.
* http/tests/workers/service/resources/basic-messageport.js: Added.
* http/tests/workers/service/resources/messageport-echo-worker.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227425 268f45cc-cd09-0410-ab3c-d52691b4dbfc
61 files changed:
LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/http/tests/workers/service/basic-messageport-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/basic-messageport.html [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/basic-messageport.js [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/messageport-echo-worker.js [new file with mode: 0644]
LayoutTests/imported/w3c/ChangeLog
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/extendable-message-event.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/postmessage.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/unregister.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-affect-other-registration.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-fetch.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-not-using-registration.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-using-registration.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/claim-worker-fetch.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/client-id.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get-cross-origin.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-get.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-client-types.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-exact-controller.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall-order.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/clients-matchall.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/extendable-event-async-waituntil.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-async-respond-with.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-respond-with-stops-propagation.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-event-throws-after-respond-with.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-base-url.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-css-images.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-fallback.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-no-freshness-headers.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/fetch-request-resources.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/immutable-prototype-serviceworker.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/redirected-response.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-end-to-end.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/registration-events.https-expected.txt
LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/skip-waiting-installed.https-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/dom/messageports/MessagePortChannel.cpp
Source/WebCore/dom/messageports/MessagePortChannel.h
Source/WebCore/workers/service/SWClientConnection.cpp
Source/WebCore/workers/service/SWClientConnection.h
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorkerClient.cpp
Source/WebCore/workers/service/context/SWContextManager.cpp
Source/WebCore/workers/service/context/SWContextManager.h
Source/WebKit/ChangeLog
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/UIProcess/WebProcessProxy.cpp
Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWClientConnection.h
Source/WebKit/WebProcess/Storage/WebSWClientConnection.messages.in
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in