Bug 181942 - SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
Summary: SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Service Workers (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: youenn fablet
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-22 13:10 PST by youenn fablet
Modified: 2018-01-22 14:15 PST (History)
5 users (show)

See Also:


Attachments
Patch (1.95 KB, patch)
2018-01-22 13:15 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 2018-01-22 13:10:26 PST
SW: Make sure ServiceWorker loading and requests are correctly cleared by ITP
Comment 1 youenn fablet 2018-01-22 13:10:52 PST
<rdar://problem/35132091>
Comment 2 youenn fablet 2018-01-22 13:15:26 PST
Created attachment 331955 [details]
Patch
Comment 3 John Wilander 2018-01-22 13:17:24 PST
Comment on attachment 331955 [details]
Patch

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

Looks good to me. Not a reviewer though.

> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:62
> +        WebsiteDataType::DOMCache,

This will make ITP start clearing DOM cache on non-SW too. I assume that's what you want.
Comment 4 youenn fablet 2018-01-22 13:23:10 PST
(In reply to John Wilander from comment #3)
> Comment on attachment 331955 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331955&action=review
> 
> Looks good to me. Not a reviewer though.
> 
> > Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:62
> > +        WebsiteDataType::DOMCache,
> 
> This will make ITP start clearing DOM cache on non-SW too. I assume that's
> what you want.

Yes, DOMCache is not very different from IDB except that it is request/response specific.
Comment 5 Chris Dumez 2018-01-22 13:25:45 PST
Comment on attachment 331955 [details]
Patch

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

> Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:73
> +        WebsiteDataType::ServiceWorkerRegistrations,

Why do we want to clear SW registrations? To maintain any state, the SW would have to use an API such as DOMCache or IDB no?
Comment 6 youenn fablet 2018-01-22 13:27:38 PST
(In reply to Chris Dumez from comment #5)
> Comment on attachment 331955 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331955&action=review
> 
> > Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:73
> > +        WebsiteDataType::ServiceWorkerRegistrations,
> 
> Why do we want to clear SW registrations? To maintain any state, the SW
> would have to use an API such as DOMCache or IDB no?

John might know more but I would think that the JavaScript might contain a token that is specific for every fetch of the JavaScript that is not conditional.
Comment 7 John Wilander 2018-01-22 13:28:08 PST
(In reply to Chris Dumez from comment #5)
> Comment on attachment 331955 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=331955&action=review
> 
> > Source/WebKit/UIProcess/WebResourceLoadStatisticsStore.cpp:73
> > +        WebsiteDataType::ServiceWorkerRegistrations,
> 
> Why do we want to clear SW registrations? To maintain any state, the SW
> would have to use an API such as DOMCache or IDB no?

Can the registration itself can be used as state? Can a third party make registrations look different in any way across sites?
Comment 8 youenn fablet 2018-01-22 13:28:20 PST
> John might know more but I would think that the JavaScript might contain a
> token that is specific for every fetch of the JavaScript that is not
> conditional.

When JS fetch is conditional, it would obviously return a 304.
Comment 9 WebKit Commit Bot 2018-01-22 14:15:27 PST
Comment on attachment 331955 [details]
Patch

Clearing flags on attachment: 331955

Committed r227358: <https://trac.webkit.org/changeset/227358>
Comment 10 WebKit Commit Bot 2018-01-22 14:15:28 PST
All reviewed patches have been landed.  Closing bug.