Refactor MessagePortChannel family classes for an easier multi-process split.
authorbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Dec 2017 01:17:45 +0000 (01:17 +0000)
committerbeidson@apple.com <beidson@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Dec 2017 01:17:45 +0000 (01:17 +0000)
commit7d3a6db6d47c7c129e9eb69c2621b070697594c6
tree373c0665c42a6b320f8cc9c72236d45e5cd50b21
parent53f4ed4bcab2003779038819fc3e640b7f19974d
Refactor MessagePortChannel family classes for an easier multi-process split.
https://bugs.webkit.org/show_bug.cgi?id=180981

Reviewed by Andy Estes.

No new tests (Refactor, no behavior change)

- Make MessagePortChannel an abstract class instead of a wrapper around a mysterious "platform" class.
- Implement the "in-process" channel for WK1 and WK2-for-now.
- Other random cleanup and modernization of this code.

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

* dom/InProcessMessagePortChannel.cpp: Added.
(WebCore::InProcessMessagePortChannel::createChannelBetweenPorts):
(WebCore::InProcessMessagePortChannel::create):
(WebCore::InProcessMessagePortChannel::InProcessMessagePortChannel):
(WebCore::InProcessMessagePortChannel::~InProcessMessagePortChannel):
(WebCore::InProcessMessagePortChannel::postMessageToRemote):
(WebCore::InProcessMessagePortChannel::takeAllMessagesFromRemote):
(WebCore::InProcessMessagePortChannel::isConnectedTo):
(WebCore::InProcessMessagePortChannel::entangleIfOpen):
(WebCore::InProcessMessagePortChannel::disentangle):
(WebCore::InProcessMessagePortChannel::hasPendingActivity):
(WebCore::InProcessMessagePortChannel::locallyEntangledPort):
(WebCore::InProcessMessagePortChannel::takeEntangledChannel):
(WebCore::InProcessMessagePortChannel::close):
(WebCore::InProcessMessagePortChannel::setRemotePort):
* dom/InProcessMessagePortChannel.h: Added.
(WebCore::InProcessMessagePortChannel::MessagePortQueue::create):
(WebCore::InProcessMessagePortChannel::MessagePortQueue::takeAllMessages):
(WebCore::InProcessMessagePortChannel::MessagePortQueue::appendAndCheckEmpty):
(WebCore::InProcessMessagePortChannel::MessagePortQueue::isEmpty):
(WebCore::InProcessMessagePortChannel::MessagePortQueue::MessagePortQueue):

* dom/MessageChannel.cpp:
(WebCore::MessageChannel::MessageChannel):
* dom/MessageChannel.h:
(WebCore::MessageChannel::create):
(WebCore::MessageChannel::port1 const):
(WebCore::MessageChannel::port2 const):

* dom/MessagePort.cpp:
(WebCore::MessagePort::postMessage):
(WebCore::MessagePort::disentangle):
(WebCore::MessagePort::entangle):
(WebCore::MessagePort::hasPendingActivity const):
* dom/MessagePort.h:

* dom/MessagePortChannel.cpp: Added.
(WebCore::MessagePortChannel::createChannelBetweenPorts):
(WebCore::MessagePortChannel::MessagePortChannel):
* dom/MessagePortChannel.h:
(WebCore::MessagePortChannel::EventData::EventData):
(WebCore::MessagePortChannel::~MessagePortChannel):

* dom/default/PlatformMessagePortChannel.cpp: Removed.
* dom/default/PlatformMessagePortChannel.h: Removed.
* workers/service/context/ServiceWorkerThread.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226252 268f45cc-cd09-0410-ab3c-d52691b4dbfc
14 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/InProcessMessagePortChannel.cpp [new file with mode: 0644]
Source/WebCore/dom/InProcessMessagePortChannel.h [new file with mode: 0644]
Source/WebCore/dom/MessageChannel.cpp
Source/WebCore/dom/MessageChannel.h
Source/WebCore/dom/MessagePort.cpp
Source/WebCore/dom/MessagePort.h
Source/WebCore/dom/MessagePortChannel.cpp [new file with mode: 0644]
Source/WebCore/dom/MessagePortChannel.h
Source/WebCore/dom/default/PlatformMessagePortChannel.cpp [deleted file]
Source/WebCore/dom/default/PlatformMessagePortChannel.h [deleted file]
Source/WebCore/workers/service/context/ServiceWorkerThread.h