WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
NEW
182309
ServiceWorker claim should only succeed if worker is active and running according StorageProcess
https://bugs.webkit.org/show_bug.cgi?id=182309
Summary
ServiceWorker claim should only succeed if worker is active and running accor...
youenn fablet
Reported
2018-01-30 14:02:50 PST
We are only checking in service worker process right now but storage process is the one actually holding the state.
Attachments
Patch
(14.96 KB, patch)
2018-01-30 16:30 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Patch
(16.25 KB, patch)
2018-01-30 18:34 PST
,
youenn fablet
no flags
Details
Formatted Diff
Diff
Show Obsolete
(1)
View All
Add attachment
proposed patch, testcase, etc.
youenn fablet
Comment 1
2018-01-30 15:14:31 PST
<
rdar://problem/37004724
>
youenn fablet
Comment 2
2018-01-30 16:30:37 PST
Created
attachment 332719
[details]
Patch
youenn fablet
Comment 3
2018-01-30 18:34:37 PST
Created
attachment 332736
[details]
Patch
Chris Dumez
Comment 4
2018-01-30 19:36:55 PST
Comment on
attachment 332736
[details]
Patch View in context:
https://bugs.webkit.org/attachment.cgi?id=332736&action=review
> Source/WebCore/workers/service/server/SWServerRegistration.cpp:184 > + if (iterator != m_clientsUsingRegistration.end()) {
When SWServerRegistration::unregisterServerConnection() is called, we remove that connectionIdentifier from m_clientsUsingRegistration. However, the clients for this connection might still be in SWServer::m_clientToControllingWorker & SWServer::m_clientsById I believe. Thus, the maps get out of sync. Youenn, do you agree with my analysis?
youenn fablet
Comment 5
2018-01-30 20:08:06 PST
SWServerRegistration::unregisterServerConnection() is called in SWServer::Connection destructor. Before that, WebSWServerConnection destructor is calling SWServer::unregisterServiceWorkerClient() on all clients of the connection, thus taking care of SWServer::m_clientsById and SWServer::m_clientToControllingWorker. As a side note, we should probably move WebSWServerConnection::m_clientOrigins back to SWServer::Connection. That would allow doing the whole cleaning in SWServer::Connection destructor. Given the implementation of SWServer::unregisterServiceWorkerClient(), we may sometimes not call SWServerRegistration::removeClientUsingRegistration since we are trying to get back the registration from the service worker identifier and this only works if the service worker identifier is running or terminating. There is probably no guarantee that a terminating service worker is kept until all web processes refreshed their ids. WIP in
bug 182313
is trying to fix that issue.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug