Bug 233698

Summary: Persist NavigationPreloadState in service worker registration database
Product: WebKit Reporter: youenn fablet <youennf>
Component: Service WorkersAssignee: youenn fablet <youennf>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 233523    
Bug Blocks: 182852    
Attachments:
Description Flags
Patch
none
Patch
ews-feeder: commit-queue-
Patch
none
Patch for landing
none
Fixing path in API tests none

Description youenn fablet 2021-12-01 05:13:55 PST
Persist NavigationPreloadState in service worker registration database
Comment 1 youenn fablet 2021-12-01 05:29:38 PST
Created attachment 445564 [details]
Patch
Comment 2 youenn fablet 2021-12-02 00:13:38 PST
Created attachment 445684 [details]
Patch
Comment 3 youenn fablet 2021-12-02 01:41:03 PST
Created attachment 445691 [details]
Patch
Comment 4 Radar WebKit Bug Importer 2021-12-02 02:50:01 PST
<rdar://problem/85963120>
Comment 5 Chris Dumez 2021-12-02 07:16:32 PST
Comment on attachment 445691 [details]
Patch

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

> Source/WebCore/workers/service/NavigationPreloadState.h:36
> +    static NavigationPreloadState defaultValue() { return { false, "true"_s }; }

Maybe we should do `String headerValue { "true"_s };` below and use the default constructor instead of this defaultValue()? Or do we need to distinguish default-constructed objects somehow?

> Source/WebCore/workers/service/server/RegistrationStore.h:43
> +struct NavigationPreloadState;

Seems unnecessary? It isn't used in this header.
Comment 6 youenn fablet 2021-12-02 07:42:17 PST
(In reply to Chris Dumez from comment #5)
> Comment on attachment 445691 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=445691&action=review
> 
> > Source/WebCore/workers/service/NavigationPreloadState.h:36
> > +    static NavigationPreloadState defaultValue() { return { false, "true"_s }; }
> 
> Maybe we should do `String headerValue { "true"_s };` below and use the
> default constructor instead of this defaultValue()? Or do we need to
> distinguish default-constructed objects somehow?

We use default constructed NavigationPreloadState when installing context data.
It is better to keep it smaller since we are IPCing.
Or we could add a specific InstallingServiceWorkerContextData without this parameter.

> 
> > Source/WebCore/workers/service/server/RegistrationStore.h:43
> > +struct NavigationPreloadState;
> 
> Seems unnecessary? It isn't used in this header.

Right, forgot to remove it.
Comment 7 youenn fablet 2021-12-02 07:44:55 PST
Created attachment 445720 [details]
Patch for landing
Comment 8 youenn fablet 2021-12-03 05:22:11 PST
Created attachment 445845 [details]
Fixing path in API tests
Comment 9 EWS 2021-12-03 06:01:22 PST
Committed r286488 (244827@main): <https://commits.webkit.org/244827@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 445845 [details].