Bug 179517 - ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects
Summary: ServiceWorkerRegistration objects may get recycled for different SWServerRegi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-11-09 18:41 PST by Chris Dumez
Modified: 2017-11-15 09:43 PST (History)
5 users (show)

See Also:


Attachments
Patch (81.22 KB, patch)
2017-11-09 20:03 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (51.78 KB, patch)
2017-11-09 22:04 PST, Chris Dumez
no flags Details | Formatted Diff | Diff
Patch (51.59 KB, patch)
2017-11-09 22:24 PST, Chris Dumez
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2017-11-09 18:41:08 PST
ServiceWorkerRegistration objects may get recycled for different SWServerRegistration objects, leading to flakiness in the tests. Right now, we use ServiceWorkerRegistrationKey as key in the m_registration map on WebProcess side. The lifetime of the ServiceWorkerRegistration objects is tied to the lifetime of their JS wrapper. When the test does a registration for a given scope, then unregisters, then registers again for the same scope, we end up creating a new SWServerRegistration object on server side, but possibly reuse the same ServiceWorkerRegistration object on WebProcess side, if the wrapper has not been garbage collected. This is because the registrations have the same ServiceWorkerRegistrationKey.
Comment 1 Chris Dumez 2017-11-09 20:03:01 PST
Created attachment 326538 [details]
Patch
Comment 2 Chris Dumez 2017-11-09 22:04:46 PST
Created attachment 326553 [details]
Patch
Comment 3 Brady Eidson 2017-11-09 22:14:33 PST
Comment on attachment 326553 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=326553&action=review

> Source/WebCore/ChangeLog:22
> +        * WebCore.xcodeproj/project.pbxproj:

This is no longer changed \o/
Comment 4 Chris Dumez 2017-11-09 22:24:36 PST
Created attachment 326555 [details]
Patch
Comment 5 Chris Dumez 2017-11-09 22:26:45 PST
Comment on attachment 326555 [details]
Patch

Clearing flags on attachment: 326555

Committed r224664: <https://trac.webkit.org/changeset/224664>
Comment 6 Chris Dumez 2017-11-09 22:26:47 PST
All reviewed patches have been landed.  Closing bug.
Comment 7 Radar WebKit Bug Importer 2017-11-15 09:43:24 PST
<rdar://problem/35562308>