Populate self.registration.installing/waiting/active inside service workers
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 20:40:04 +0000 (20:40 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 30 Nov 2017 20:40:04 +0000 (20:40 +0000)
commitaa66e2205d7f6bf61bcf6bfd72589b17119fe4b9
tree588b4ce47a14d86fc73cc11ff14216cbb688b437
parentfd19f70468ca9d1fe77a081b06e22b2a989dbd07
Populate self.registration.installing/waiting/active inside service workers
https://bugs.webkit.org/show_bug.cgi?id=180168

Reviewed by Brady Eidson.

LayoutTests/imported/w3c:

Rebaseline a couple of WPT that now pass for checks.

* web-platform-tests/service-workers/service-worker/ServiceWorkerGlobalScope/registration-attribute.https-expected.txt:
* web-platform-tests/service-workers/service-worker/navigation-redirect.https-expected.txt:

Source/WebCore:

Populate self.registration.installing/waiting/active inside service workers.
Also make sure the ServiceWorker's state properly gets updated inside
service workers.

No new tests, extended existing test for self.registration.

* workers/service/ServiceWorker.cpp:
(WebCore::ServiceWorker::scheduleTaskToUpdateState):
* workers/service/context/SWContextManager.cpp:
(WebCore::SWContextManager::forEachServiceWorkerThread):
* workers/service/context/SWContextManager.h:
* workers/service/context/ServiceWorkerThread.cpp:
(WebCore::ServiceWorkerThread::fireInstallEvent):
(WebCore::ServiceWorkerThread::fireActivateEvent):
* workers/service/server/SWClientConnection.cpp:
(WebCore::SWClientConnection::updateRegistrationState):
(WebCore::SWClientConnection::updateWorkerState):
(WebCore::SWClientConnection::fireUpdateFoundEvent):
* workers/service/server/SWClientConnection.h:

Source/WTF:

Add CrossThreadCopier support for std::optional<>.

* wtf/CrossThreadCopier.h:

LayoutTests:

Extend layout test coverage.

* http/tests/workers/service/resources/self_registration-worker.js:
* http/tests/workers/service/self_registration-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225341 268f45cc-cd09-0410-ab3c-d52691b4dbfc
15 files changed:
LayoutTests/ChangeLog
LayoutTests/http/tests/workers/service/resources/self_registration-worker.js
LayoutTests/http/tests/workers/service/self_registration-expected.txt
LayoutTests/imported/w3c/ChangeLog
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/navigation-redirect.https-expected.txt
Source/WTF/ChangeLog
Source/WTF/wtf/CrossThreadCopier.h
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorker.cpp
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/server/SWClientConnection.cpp
Source/WebCore/workers/service/server/SWClientConnection.h