imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:57:02 +0000 (19:57 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Dec 2017 19:57:02 +0000 (19:57 +0000)
https://bugs.webkit.org/show_bug.cgi?id=180867

Reviewed by Brady Eidson.

Fix assertion to make sure the worker is terminating if it is already in m_runningOrTerminatingWorkers.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::runServiceWorker):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225976 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp

index 8d604bf..1455a7e 100644 (file)
@@ -1,5 +1,17 @@
 2017-12-15  Chris Dumez  <cdumez@apple.com>
 
+        imported/w3c/web-platform-tests/service-workers/service-worker/update.https.html is sometimes crashing in Debug builds
+        https://bugs.webkit.org/show_bug.cgi?id=180867
+
+        Reviewed by Brady Eidson.
+
+        Fix assertion to make sure the worker is terminating if it is already in m_runningOrTerminatingWorkers.
+
+        * workers/service/server/SWServer.cpp:
+        (WebCore::SWServer::runServiceWorker):
+
+2017-12-15  Chris Dumez  <cdumez@apple.com>
+
         Service Worker Registration promise is sometimes not rejected when the script load fails
         https://bugs.webkit.org/show_bug.cgi?id=180849
 
index 94f9fa0..7f16868 100644 (file)
@@ -518,7 +518,7 @@ bool SWServer::runServiceWorker(ServiceWorkerIdentifier identifier)
         return false;
 
     auto addResult = m_runningOrTerminatingWorkers.add(identifier, *worker);
-    ASSERT_UNUSED(addResult, addResult.isNewEntry);
+    ASSERT_UNUSED(addResult, addResult.isNewEntry || worker->isTerminating());
 
     worker->setState(SWServerWorker::State::Running);