ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWai...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jan 2018 04:09:43 +0000 (04:09 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jan 2018 04:09:43 +0000 (04:09 +0000)
commit0c269928c7e2d29f3db827fd67671df64f873eb7
tree8aeef50e86cf1b057a94c0ec4f629d5b04364e28
parenta65ea2158a7530c0babf13594ab95183dbc0bea8
ASSERTION FAILED: registration || isTerminating() in WebCore::SWServerWorker::skipWaiting()
https://bugs.webkit.org/show_bug.cgi?id=181603
<rdar://problem/36476050>

Reviewed by Youenn Fablet.

No new tests, covered by existing tests that crash flakily.

* workers/service/server/SWServer.cpp:
(WebCore::SWServer::terminateWorkerInternal):
If the connection to the context process is gone, make sure we make the worker as terminated
so that it does not stay in Running state and in SWServer::m_runningOrTerminatingWorkers.

* workers/service/server/SWServerRegistration.cpp:
(WebCore::SWServerRegistration::~SWServerRegistration):
Add assertions to make sure none of the registration's workers are still running when
the registration is destroyed.

(WebCore::SWServerRegistration::updateRegistrationState):
Make sure registration workers that are overwritten are not still running.

* workers/service/server/SWServerWorker.cpp:
(WebCore::SWServerWorker::setState):
If a worker's state is set to redundant, make sure we also terminate it.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@226934 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/workers/service/server/SWServer.cpp
Source/WebCore/workers/service/server/SWServerRegistration.cpp
Source/WebCore/workers/service/server/SWServerWorker.cpp
Source/WebCore/workers/service/server/SWServerWorker.h