You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WebSWClientConnection should do IPC to StorageProcess if its WebSWOriginTable is not yet initialized
https://bugs.webkit.org/show_bug.cgi?id=179668
Patch by Youenn Fablet <[email protected]> on 2017-11-14
Reviewed by Chris Dumez.
Source/WebCore:
Covered by existing updated tests.
Removing hasServiceWorkerRegisteredForOrigin and using hasServiceWorkerRegistration instead.
The former is only checking the shared map which might not be initialized at the time the function is called.
The latter is going to the StorageProcess if the map is not yet initialized.
* testing/Internals.cpp:
(WebCore::Internals::hasServiceWorkerRegisteredForOrigin): Deleted.
* testing/Internals.h:
* testing/Internals.idl:
* workers/service/server/SWClientConnection.h:
Source/WebKit:
There may be cases where the origin table is not initialized and we would think there is no service worker registration.
In such a case, we should go to the StorageProcess.
StorageProcess is now sending an IPC message back to each registered SW connection so that WebProcess will know whether its map
is correctly initialized or not.
Renaming hasServiceWorkerRegisteredForOrigin in mayHaveServiceWorkerRegisteredForOrigin.
* WebProcess/Storage/WebSWClientConnection.cpp:
(WebKit::WebSWClientConnection::mayHaveServiceWorkerRegisteredForOrigin const):
(WebKit::WebSWClientConnection::matchRegistration):
(WebKit::WebSWClientConnection::hasServiceWorkerRegisteredForOrigin const): Deleted.
* WebProcess/Storage/WebSWClientConnection.h:
* WebProcess/Storage/WebSWOriginTable.h:
(WebKit::WebSWOriginTable::isInitialized const):
* WebProcess/Storage/WebServiceWorkerProvider.cpp:
(WebKit::shouldHandleFetch):
LayoutTests:
Updated tests to use hasServiceWorkerRegistration instead of hasServiceWorkerRegisteredForOrigin.
Since the latter is trying to match a registration and compares scopes, we need the scopes to be set right on the tests.
* http/tests/workers/service/basic-unregister.https-expected.txt:
* http/tests/workers/service/resources/basic-register.js:
* http/tests/workers/service/resources/basic-unregister.js:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@224832 268f45cc-cd09-0410-ab3c-d52691b4dbfc
0 commit comments