[Service Workers] Implement Client API
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 18:00:24 +0000 (18:00 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 15 Nov 2017 18:00:24 +0000 (18:00 +0000)
commite7ee80290b30cd861f50ee46651880e01289275b
tree3cac6abb74fcd765c604cee27bdfc017851e5975
parent8147aff613a2183b633276dd0b9f2f1ae1fb89f9
[Service Workers] Implement Client API
https://bugs.webkit.org/show_bug.cgi?id=179709

Reviewed by Alex Christensen.

Source/WebCore:

Implement Client API as per:
- https://w3c.github.io/ServiceWorker/#client-interface

Tests:
http/tests/workers/service/Client-properties.html
http/tests/workers/service/Client-properties-subframe.html
http/tests/workers/service/Client-properties-auxiliary.html

* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:
* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::postMessage):
* workers/service/ServiceWorkerClient.cpp:
(WebCore::ServiceWorkerClient::ServiceWorkerClient):
(WebCore::ServiceWorkerClient::url const):
(WebCore::ServiceWorkerClient::type const):
(WebCore::ServiceWorkerClient::frameType const):
(WebCore::ServiceWorkerClient::id const):
(WebCore::ServiceWorkerClient::postMessage):
* workers/service/ServiceWorkerClient.h:
(WebCore::ServiceWorkerClient::create):
* workers/service/ServiceWorkerClientData.cpp: Copied from Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp.
(WebCore::toServiceWorkerClientFrameType):
(WebCore::ServiceWorkerClientData::isolatedCopy const):
(WebCore::ServiceWorkerClientData::from):
* workers/service/ServiceWorkerClientData.h: Copied from Source/WebCore/workers/service/ServiceWorkerClient.h.
(WebCore::ServiceWorkerClientData::encode const):
(WebCore::ServiceWorkerClientData::decode):
* workers/service/ServiceWorkerClientIdentifier.h:
(WebCore::ServiceWorkerClientIdentifier::encode const):
(WebCore::ServiceWorkerClientIdentifier::decode):
* workers/service/ServiceWorkerTypes.h:
* workers/service/ServiceWorkerWindowClient.cpp:
(WebCore::ServiceWorkerWindowClient::ServiceWorkerWindowClient):
* workers/service/ServiceWorkerWindowClient.h:
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::postMessageToServiceWorkerGlobalScope):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::postMessageToServiceWorkerGlobalScope):
* workers/service/context/ServiceWorkerThread.h:
* workers/service/server/SWClientConnection.h:

Source/WebKit:

* Shared/WebCoreArgumentCoders.cpp:
* Shared/WebCoreArgumentCoders.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.cpp:
(WebKit::WebSWServerConnection::postMessageToServiceWorkerGlobalScope):
* StorageProcess/ServiceWorker/WebSWServerConnection.h:
* StorageProcess/ServiceWorker/WebSWServerConnection.messages.in:
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.cpp:
(WebKit::WebSWContextManagerConnection::postMessageToServiceWorkerGlobalScope):
* WebProcess/Storage/WebSWContextManagerConnection.h:
* WebProcess/Storage/WebSWContextManagerConnection.messages.in:

LayoutTests:

Add layout test coverage.

* http/tests/workers/service/Client-properties-auxiliary-expected.txt: Added.
* http/tests/workers/service/Client-properties-auxiliary.html: Added.
* http/tests/workers/service/Client-properties-expected.txt: Added.
* http/tests/workers/service/Client-properties-subframe-expected.txt: Added.
* http/tests/workers/service/Client-properties-subframe.html: Added.
* http/tests/workers/service/Client-properties.html: Added.
* http/tests/workers/service/resources/Client-properties-worker.js: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@224880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
39 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/Client-properties-auxiliary-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/Client-properties-auxiliary.html [new file with mode: 0644]
LayoutTests/http/tests/workers/service/Client-properties-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/Client-properties-subframe-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/workers/service/Client-properties-subframe.html [new file with mode: 0644]
LayoutTests/http/tests/workers/service/Client-properties.html [new file with mode: 0644]
LayoutTests/http/tests/workers/service/resources/Client-properties-worker.js [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/workers/service/ServiceWorker.cpp
Source/WebCore/workers/service/ServiceWorkerClient.cpp
Source/WebCore/workers/service/ServiceWorkerClient.h
Source/WebCore/workers/service/ServiceWorkerClientData.cpp [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClientData.h [new file with mode: 0644]
Source/WebCore/workers/service/ServiceWorkerClientIdentifier.h
Source/WebCore/workers/service/ServiceWorkerClientType.h
Source/WebCore/workers/service/ServiceWorkerRegistrationData.h
Source/WebCore/workers/service/ServiceWorkerTypes.h
Source/WebCore/workers/service/ServiceWorkerUpdateViaCache.h
Source/WebCore/workers/service/ServiceWorkerWindowClient.cpp
Source/WebCore/workers/service/ServiceWorkerWindowClient.h
Source/WebCore/workers/service/context/SWContextManager.cpp
Source/WebCore/workers/service/context/SWContextManager.h
Source/WebCore/workers/service/context/ServiceWorkerThread.cpp
Source/WebCore/workers/service/context/ServiceWorkerThread.h
Source/WebCore/workers/service/server/SWClientConnection.h
Source/WebKit/ChangeLog
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
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.cpp
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.h
Source/WebKit/WebProcess/Storage/WebSWContextManagerConnection.messages.in