Title: [228015] trunk
- Revision
- 228015
- Author
- cdu...@apple.com
- Date
- 2018-02-02 09:33:53 -0800 (Fri, 02 Feb 2018)
Log Message
Clearing a registration should null out its workers before setting their state to "redundant"
https://bugs.webkit.org/show_bug.cgi?id=182418
<rdar://problem/37142874>
Reviewed by Youenn Fablet.
LayoutTests/imported/w3c:
Rebaseline WPT test now that all checks are passing. I verified that this test is passing
in both Firefox and Chrome.
* web-platform-tests/service-workers/service-worker/activation.https-expected.txt:
Source/WebCore:
Clearing a registration should null out its workers before setting their state to "redundant".
This seems to match Firefox and Chrome.
No new tests, rebaselined existing test.
* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::clear):
(WebCore::clearRegistrationWorker): Deleted.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (228014 => 228015)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-02-02 17:25:24 UTC (rev 228014)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-02-02 17:33:53 UTC (rev 228015)
@@ -1,3 +1,16 @@
+2018-02-02 Chris Dumez <cdu...@apple.com>
+
+ Clearing a registration should null out its workers before setting their state to "redundant"
+ https://bugs.webkit.org/show_bug.cgi?id=182418
+ <rdar://problem/37142874>
+
+ Reviewed by Youenn Fablet.
+
+ Rebaseline WPT test now that all checks are passing. I verified that this test is passing
+ in both Firefox and Chrome.
+
+ * web-platform-tests/service-workers/service-worker/activation.https-expected.txt:
+
2018-02-02 Ms2ger <ms2...@igalia.com>
Update imagebitmap tests.
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt (228014 => 228015)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt 2018-02-02 17:25:24 UTC (rev 228014)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt 2018-02-02 17:33:53 UTC (rev 228015)
@@ -3,5 +3,5 @@
PASS loss of controllees triggers activation
PASS finishing a request triggers activation
PASS skipWaiting bypasses no controllee requirement
-FAIL finishing a request triggers unregister assert_equals: expected null but got object "[object ServiceWorker]"
+PASS finishing a request triggers unregister
Modified: trunk/Source/WebCore/ChangeLog (228014 => 228015)
--- trunk/Source/WebCore/ChangeLog 2018-02-02 17:25:24 UTC (rev 228014)
+++ trunk/Source/WebCore/ChangeLog 2018-02-02 17:33:53 UTC (rev 228015)
@@ -1,3 +1,20 @@
+2018-02-02 Chris Dumez <cdu...@apple.com>
+
+ Clearing a registration should null out its workers before setting their state to "redundant"
+ https://bugs.webkit.org/show_bug.cgi?id=182418
+ <rdar://problem/37142874>
+
+ Reviewed by Youenn Fablet.
+
+ Clearing a registration should null out its workers before setting their state to "redundant".
+ This seems to match Firefox and Chrome.
+
+ No new tests, rebaselined existing test.
+
+ * workers/service/server/SWServerRegistration.cpp:
+ (WebCore::SWServerRegistration::clear):
+ (WebCore::clearRegistrationWorker): Deleted.
+
2018-02-02 Antoine Quint <grao...@apple.com>
[Modern Media Controls] Turn media/modern-media-controls/tracks-panel and media/modern-media-controls/tracks-support back on
Modified: trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp (228014 => 228015)
--- trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2018-02-02 17:25:24 UTC (rev 228014)
+++ trunk/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2018-02-02 17:33:53 UTC (rev 228015)
@@ -228,17 +228,6 @@
}
// https://w3c.github.io/ServiceWorker/#clear-registration
-static void clearRegistrationWorker(SWServerRegistration& registration, SWServerWorker* worker, ServiceWorkerRegistrationState state)
-{
- if (!worker)
- return;
-
- worker->terminate();
- registration.updateWorkerState(*worker, ServiceWorkerState::Redundant);
- registration.updateRegistrationState(state, nullptr);
-}
-
-// https://w3c.github.io/ServiceWorker/#clear-registration
void SWServerRegistration::clear()
{
if (m_preInstallationWorker) {
@@ -247,10 +236,29 @@
m_preInstallationWorker = nullptr;
}
- clearRegistrationWorker(*this, installingWorker(), ServiceWorkerRegistrationState::Installing);
- clearRegistrationWorker(*this, waitingWorker(), ServiceWorkerRegistrationState::Waiting);
- clearRegistrationWorker(*this, activeWorker(), ServiceWorkerRegistrationState::Active);
+ RefPtr<SWServerWorker> installingWorker = this->installingWorker();
+ if (installingWorker) {
+ installingWorker->terminate();
+ updateRegistrationState(ServiceWorkerRegistrationState::Installing, nullptr);
+ }
+ RefPtr<SWServerWorker> waitingWorker = this->waitingWorker();
+ if (waitingWorker) {
+ waitingWorker->terminate();
+ updateRegistrationState(ServiceWorkerRegistrationState::Waiting, nullptr);
+ }
+ RefPtr<SWServerWorker> activeWorker = this->activeWorker();
+ if (activeWorker) {
+ activeWorker->terminate();
+ updateRegistrationState(ServiceWorkerRegistrationState::Active, nullptr);
+ }
+ if (installingWorker)
+ updateWorkerState(*installingWorker, ServiceWorkerState::Redundant);
+ if (waitingWorker)
+ updateWorkerState(*waitingWorker, ServiceWorkerState::Redundant);
+ if (activeWorker)
+ updateWorkerState(*activeWorker, ServiceWorkerState::Redundant);
+
// Remove scope to registration map[scopeString].
m_server.removeRegistration(key());
}
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes