Introduce ServiceWorkerContainer::ensureSWClientConnection()
https://bugs.webkit.org/show_bug.cgi?id=180146
Reviewed by Youenn Fablet.
Introduce ServiceWorkerContainer::ensureSWClientConnection() to reduce
code duplication. Also use callOnMainThread() in preparation for this
getting called from a service worker thread (now that ServiceWorkerContainer
is exposed to service workers). This is needed because constructing the
SWClientConnection initializes the IPC connection from the WebProcess to
the StorageProcess, which involves a synchronous IPC with the UIProcess.
Doing a synchronous IPC from a background thread is unsupported.
* workers/service/ServiceWorkerContainer.cpp:
(WebCore::ServiceWorkerContainer::addRegistration):
(WebCore::ServiceWorkerContainer::getRegistration):
(WebCore::ServiceWorkerContainer::getRegistrations):
(WebCore::ServiceWorkerContainer::ensureSWClientConnection):
* workers/service/ServiceWorkerContainer.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225283
268f45cc-cd09-0410-ab3c-
d52691b4dbfc