Title: [228069] branches/safari-605-branch
- Revision
- 228069
- Author
- jmarc...@apple.com
- Date
- 2018-02-04 21:30:30 -0800 (Sun, 04 Feb 2018)
Log Message
Cherry-pick r228015. rdar://problem/37220133
Modified Paths
Diff
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog (228068 => 228069)
--- branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-02-05 05:30:28 UTC (rev 228068)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/ChangeLog 2018-02-05 05:30:30 UTC (rev 228069)
@@ -1,5 +1,22 @@
2018-02-04 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r228015. rdar://problem/37220133
+
+ 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-04 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227997. rdar://problem/37220136
2018-02-01 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt (228068 => 228069)
--- branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt 2018-02-05 05:30:28 UTC (rev 228068)
+++ branches/safari-605-branch/LayoutTests/imported/w3c/web-platform-tests/service-workers/service-worker/activation.https-expected.txt 2018-02-05 05:30:30 UTC (rev 228069)
@@ -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: branches/safari-605-branch/Source/WebCore/ChangeLog (228068 => 228069)
--- branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-05 05:30:28 UTC (rev 228068)
+++ branches/safari-605-branch/Source/WebCore/ChangeLog 2018-02-05 05:30:30 UTC (rev 228069)
@@ -1,5 +1,26 @@
2018-02-04 Jason Marcell <jmarc...@apple.com>
+ Cherry-pick r228015. rdar://problem/37220133
+
+ 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-04 Jason Marcell <jmarc...@apple.com>
+
Cherry-pick r227997. rdar://problem/37220136
2018-02-01 Chris Dumez <cdu...@apple.com>
Modified: branches/safari-605-branch/Source/WebCore/workers/service/server/SWServerRegistration.cpp (228068 => 228069)
--- branches/safari-605-branch/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2018-02-05 05:30:28 UTC (rev 228068)
+++ branches/safari-605-branch/Source/WebCore/workers/service/server/SWServerRegistration.cpp 2018-02-05 05:30:30 UTC (rev 228069)
@@ -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