Bring back SWContextManager abstraction in WebCore
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 20:14:40 +0000 (20:14 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Oct 2017 20:14:40 +0000 (20:14 +0000)
commit84d808c8a6cad6f38e0be8e98ca6cfa57d891852
tree5da2f2ba1da8b37cefc1d2b9f414d787c8e042b4
parent74be6e266abfd2843b877dd2374f9e6af68cffc0
Bring back SWContextManager abstraction in WebCore
https://bugs.webkit.org/show_bug.cgi?id=178876

Reviewed by Geoffrey Garen.

Bring back SWContextManager abstraction in WebCore. It was killed in <https://trac.webkit.org/changeset/223718> but
is actually useful when the ServiceWorker wants to message the storage process.

Source/WebCore:

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/context/SWContextManager.cpp: Added.
(WebCore::SWContextManager::singleton):
(WebCore::SWContextManager::setConnection):
(WebCore::SWContextManager::connection const):
(WebCore::SWContextManager::registerServiceWorkerThread):
(WebCore::SWContextManager::serviceWorkerThreadProxy const):
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h: Copied from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
(WebCore::SWContextManager::Connection::~Connection):

Source/WebKit:

* CMakeLists.txt:
* DerivedSources.make:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::startServiceWorkerContext):
(WebKit::WebSWServerConnection::startFetch):
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* WebKit.xcodeproj/project.pbxproj:
* WebProcess/Storage/WebSWContextManagerConnection.cpp: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp.
(WebKit::WebSWContextManagerConnection::WebSWContextManagerConnection):
(WebKit::WebSWContextManagerConnection::updatePreferences):
(WebKit::WebSWContextManagerConnection::startServiceWorker):
(WebKit::WebSWContextManagerConnection::startFetch):
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWContextManagerConnection.h: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h.
* WebProcess/Storage/WebSWContextManagerConnection.messages.in: Renamed from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in.
* WebProcess/WebProcess.cpp:
(WebKit::WebProcess::didReceiveMessage):
(WebKit::WebProcess::getWorkerContextConnection):
* WebProcess/WebProcess.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224041 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/workers/service/context/SWContextManager.cpp [new file with mode: 0644]
Source/WebCore/workers/service/context/SWContextManager.h [new file with mode: 0644]
Source/WebKit/CMakeLists.txt
Source/WebKit/ChangeLog
Source/WebKit/DerivedSources.make
Source/WebKit/StorageProcess/ServiceWorker/WebSWServerConnection.cpp
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp [moved from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.cpp with 78% similarity]
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h [moved from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.h with 81% similarity]
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in [moved from Source/WebKit/WebProcess/Storage/ServiceWorkerContextManager.messages.in with 89% similarity]
Source/WebKit/WebProcess/WebProcess.cpp
Source/WebKit/WebProcess/WebProcess.h