ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 21:56:25 +0000 (21:56 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Dec 2017 21:56:25 +0000 (21:56 +0000)
commit64fa6e3e78112fec91543829306fdc931c421eef
tree017ddb3ba5b448ad5fba0ff0d07278e52cbda480
parentec8225a59c6cc00c94e9dd6b6d914736a8e7f854
ServiceWorkerGlobalScope::skipWaiting(Ref<DeferredPromise>&&) is unsafe
https://bugs.webkit.org/show_bug.cgi?id=180372

Reviewed by Youenn Fablet.

Ref the WorkerThread and capture it in the lambda. Keep the pending promises in
a HashMap on the ServiceWorkerGlobalScope so that they stay on the worker thread.

* workers/service/ServiceWorkerGlobalScope.cpp:
(WebCore::ServiceWorkerGlobalScope::skipWaiting):
* workers/service/ServiceWorkerGlobalScope.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225491 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/workers/service/ServiceWorkerGlobalScope.cpp
Source/WebCore/workers/service/ServiceWorkerGlobalScope.h