In WebKit2, make the MessagePortChannelRegistry live in the UI process.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 18:35:23 +0000 (18:35 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 22 Jan 2018 18:35:23 +0000 (18:35 +0000)
commit1354c9c460218257131839964a1a33c3c7451653
tree71eb3096e552f5b0e0ec3ca8d30d0d0963c47f0c
parente8675dfce74e94d0dbf81740bb01970f77ebfa0e
In WebKit2, make the MessagePortChannelRegistry live in the UI process.
https://bugs.webkit.org/show_bug.cgi?id=181922

Reviewed by Andy Estes.

Source/WebCore:

No new tests (Refactor, no behavior change)

Add encoder/decoders and EXPORT a whole bunch of stuff.

* WebCore.xcodeproj/project.pbxproj:

* dom/MessagePort.h:

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

* dom/messageports/MessagePortChannelProvider.h:
* dom/messageports/MessagePortChannelRegistry.h:

* dom/messageports/MessageWithMessagePorts.h:
(WebCore::MessageWithMessagePorts::encode const):
(WebCore::MessageWithMessagePorts::decode):

Source/WebKit:

With all of the work that went into making MessagePorts be fully asynchronous
and to be process-aware, formally moving them out-of-process is just a matter
of adding WebKit IPC layers.

The basic unit of asynchronicity is "MessagePortChannelProvider", and this patch
adds both a WebMessagePortChannelProvider and UIMessagePortChannelProvider for
each side of the process divide.

* UIProcess/UIMessagePortChannelProvider.cpp: Added.
(WebKit::UIMessagePortChannelProvider::singleton):
(WebKit::UIMessagePortChannelProvider::UIMessagePortChannelProvider):
(WebKit::UIMessagePortChannelProvider::~UIMessagePortChannelProvider):
(WebKit::UIMessagePortChannelProvider::createNewMessagePortChannel):
(WebKit::UIMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
(WebKit::UIMessagePortChannelProvider::messagePortDisentangled):
(WebKit::UIMessagePortChannelProvider::messagePortClosed):
(WebKit::UIMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::UIMessagePortChannelProvider::postMessageToRemote):
(WebKit::UIMessagePortChannelProvider::checkRemotePortForActivity):
(WebKit::UIMessagePortChannelProvider::checkProcessLocalPortForActivity):
* UIProcess/UIMessagePortChannelProvider.h: Added.
(WebKit::UIMessagePortChannelProvider::registry):

* UIProcess/WebPageProxy.cpp:
(WebKit::m_configurationPreferenceValues):

* UIProcess/WebProcessProxy.cpp:
(WebKit::WebProcessProxy::processForIdentifier):
(WebKit::m_userMediaCaptureManagerProxy):
(WebKit::WebProcessProxy::~WebProcessProxy):
(WebKit::WebProcessProxy::shutDown):
(WebKit::WebProcessProxy::createNewMessagePortChannel):
(WebKit::WebProcessProxy::entangleLocalPortInThisProcessToRemote):
(WebKit::WebProcessProxy::messagePortDisentangled):
(WebKit::WebProcessProxy::messagePortClosed):
(WebKit::WebProcessProxy::takeAllMessagesForPort):
(WebKit::WebProcessProxy::didDeliverMessagePortMessages):
(WebKit::WebProcessProxy::postMessageToRemote):
(WebKit::WebProcessProxy::checkRemotePortForActivity):
(WebKit::WebProcessProxy::checkProcessLocalPortForActivity):
(WebKit::WebProcessProxy::didCheckProcessLocalPortForActivity):
* UIProcess/WebProcessProxy.h:
* UIProcess/WebProcessProxy.messages.in:

* WebKit.xcodeproj/project.pbxproj:

* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp: Added.
(WebKit::WebMessagePortChannelProvider::singleton):
(WebKit::WebMessagePortChannelProvider::WebMessagePortChannelProvider):
(WebKit::WebMessagePortChannelProvider::~WebMessagePortChannelProvider):
(WebKit::WebMessagePortChannelProvider::createNewMessagePortChannel):
(WebKit::WebMessagePortChannelProvider::entangleLocalPortInThisProcessToRemote):
(WebKit::WebMessagePortChannelProvider::messagePortDisentangled):
(WebKit::WebMessagePortChannelProvider::messagePortClosed):
(WebKit::WebMessagePortChannelProvider::takeAllMessagesForPort):
(WebKit::WebMessagePortChannelProvider::didTakeAllMessagesForPort):
(WebKit::WebMessagePortChannelProvider::didCheckRemotePortForActivity):
(WebKit::WebMessagePortChannelProvider::postMessageToRemote):
(WebKit::WebMessagePortChannelProvider::checkProcessLocalPortForActivity):
(WebKit::WebMessagePortChannelProvider::checkRemotePortForActivity):
* WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h: Added.

* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::initializeProcess):
(WebKit::WebProcess::didTakeAllMessagesForPort):
(WebKit::WebProcess::checkProcessLocalPortForActivity):
(WebKit::WebProcess::didCheckRemotePortForActivity):
(WebKit::WebProcess::messagesAvailableForPort):
* WebProcess/WebProcess.h:
* WebProcess/WebProcess.messages.in:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@227340 268f45cc-cd09-0410-ab3c-d52691b4dbfc
22 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/MessagePort.h
Source/WebCore/dom/messageports/MessagePortChannel.cpp
Source/WebCore/dom/messageports/MessagePortChannel.h
Source/WebCore/dom/messageports/MessagePortChannelProvider.h
Source/WebCore/dom/messageports/MessagePortChannelRegistry.h
Source/WebCore/dom/messageports/MessageWithMessagePorts.h
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/UIProcess/UIMessagePortChannelProvider.cpp [new file with mode: 0644]
Source/WebKit/UIProcess/UIMessagePortChannelProvider.h [new file with mode: 0644]
Source/WebKit/UIProcess/WebPageProxy.cpp
Source/WebKit/UIProcess/WebProcessProxy.cpp
Source/WebKit/UIProcess/WebProcessProxy.h
Source/WebKit/UIProcess/WebProcessProxy.messages.in
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/WebCoreSupport/WebMessagePortChannelProvider.cpp [new file with mode: 0644]
Source/WebKit/WebProcess/WebCoreSupport/WebMessagePortChannelProvider.h [new file with mode: 0644]
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h
Source/WebKit/WebProcess/WebProcess.messages.in