Bug 180359 - Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
Summary: Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
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: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-12-04 09:05 PST by youenn fablet
Modified: 2017-12-04 10:56 PST (History)
4 users (show)

See Also:


Attachments
Patch (2.81 KB, patch)
2017-12-04 09:42 PST, youenn fablet
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description youenn fablet 2017-12-04 09:05:41 PST
Add support https://w3c.github.io/ServiceWorker/#on-client-unload-algorithm
Comment 1 youenn fablet 2017-12-04 09:42:18 PST
Created attachment 328354 [details]
Patch
Comment 2 Chris Dumez 2017-12-04 10:24:33 PST
Comment on attachment 328354 [details]
Patch

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

> Source/WebCore/workers/service/server/SWServerRegistration.cpp:165
> +    handleClientUnload();

This looks wrong to me. The fact that removeClientUsingRegistration() is called does not necessarily mean a client was unloaded.
Comment 3 Chris Dumez 2017-12-04 10:26:09 PST
Comment on attachment 328354 [details]
Patch

I guess it does not matter though because the algorithm is a no-op when the unloaded client is not using the registration.
Comment 4 Chris Dumez 2017-12-04 10:29:06 PST
Comment on attachment 328354 [details]
Patch

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

yeah, seems fine given the client unload algorithm.

> Source/WebCore/workers/service/server/SWServerRegistration.cpp:293
> +        return;

Technically the spec does not return here. I don't know if is matters or if it is a bug in the spec. Do we ever want to call tryActivate() on a registration that is uninstalling?
Comment 5 youenn fablet 2017-12-04 10:35:42 PST
(In reply to Chris Dumez from comment #4)
> Comment on attachment 328354 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=328354&action=review
> 
> yeah, seems fine given the client unload algorithm.
> 
> > Source/WebCore/workers/service/server/SWServerRegistration.cpp:293
> > +        return;
> 
> Technically the spec does not return here. I don't know if is matters or if
> it is a bug in the spec. Do we ever want to call tryActivate() on a
> registration that is uninstalling?

Right, spec could be made clearer here.
Comment 6 WebKit Commit Bot 2017-12-04 10:55:11 PST
Comment on attachment 328354 [details]
Patch

Clearing flags on attachment: 328354

Committed r225483: <https://trac.webkit.org/changeset/225483>
Comment 7 WebKit Commit Bot 2017-12-04 10:55:12 PST
All reviewed patches have been landed.  Closing bug.
Comment 8 Radar WebKit Bug Importer 2017-12-04 10:56:25 PST
<rdar://problem/35833226>