Bug 203410

Summary: WebProcess should unregister its interest for a SWServerRegistration when all its corresponding ServiceWorkerRegistrations are destroyed
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, cdumez, commit-queue, repstein, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

youenn fablet
Reported 2019-10-25 07:22:42 PDT
WebProcess should unregister its interest for a SWServerRegistration when all its corresponding ServiceWorkerRegistrations are destroyed
Attachments
Patch (8.40 KB, patch)
2019-10-25 07:28 PDT, youenn fablet
no flags
Patch (8.39 KB, patch)
2019-10-25 07:35 PDT, youenn fablet
no flags
Patch (8.50 KB, patch)
2019-10-25 08:06 PDT, youenn fablet
no flags
Patch (8.48 KB, patch)
2019-10-25 08:51 PDT, youenn fablet
no flags
youenn fablet
Comment 1 2019-10-25 07:28:07 PDT
youenn fablet
Comment 2 2019-10-25 07:30:02 PDT
*** Bug 203218 has been marked as a duplicate of this bug. ***
youenn fablet
Comment 3 2019-10-25 07:30:38 PDT
youenn fablet
Comment 4 2019-10-25 07:35:08 PDT
youenn fablet
Comment 5 2019-10-25 08:06:55 PDT
Chris Dumez
Comment 6 2019-10-25 08:14:37 PDT
Comment on attachment 381923 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=381923&action=review > Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:89 > send(Messages::WebSWServerConnection::AddServiceWorkerRegistrationInServer { identifier }); Why do we send unconditionally and and not when going from 0 to 1? > Source/WebKit/WebProcess/WebProcess.cpp:1765 > +bool WebProcess::decrementServiceWorkerRegistrationCount(WebCore::ServiceWorkerRegistrationIdentifier identifier) It is unclear from the name what the returned boolean means. I think it should be factored differently. > Source/WebKit/WebProcess/WebProcess.h:585 > + HashMap<WebCore::ServiceWorkerRegistrationIdentifier, size_t> m_swRegistrationCounts; Seems like a perfect use case for a HashCountedSet?
youenn fablet
Comment 7 2019-10-25 08:37:13 PDT
> > Source/WebKit/WebProcess/Storage/WebSWClientConnection.cpp:89 > > send(Messages::WebSWServerConnection::AddServiceWorkerRegistrationInServer { identifier }); > > Why do we send unconditionally and and not when going from 0 to 1? I preferred not doing that because we probably have an issue in case of network process crash where we should reregister them. Currently, we keep the status quo which gives a chance for a reload to fix the issue. Once we update the code to handle network process crash, we should indeed do that. > > Source/WebKit/WebProcess/WebProcess.h:585 > > + HashMap<WebCore::ServiceWorkerRegistrationIdentifier, size_t> m_swRegistrationCounts; > > Seems like a perfect use case for a HashCountedSet? OK, will do.
youenn fablet
Comment 8 2019-10-25 08:51:46 PDT
Chris Dumez
Comment 9 2019-10-25 08:56:31 PDT
Comment on attachment 381927 [details] Patch r=me.
WebKit Commit Bot
Comment 10 2019-10-25 12:04:35 PDT
Comment on attachment 381927 [details] Patch Clearing flags on attachment: 381927 Committed r251598: <https://trac.webkit.org/changeset/251598>
WebKit Commit Bot
Comment 11 2019-10-25 12:04:36 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.