Bug 209246

Summary: Pass isNavigatingToAppBoundDomain for speculative loads, preconnect tasks and downloads
Product: WebKit Reporter: Kate Cheney <katherine_cheney>
Component: WebKit Misc.Assignee: Kate Cheney <katherine_cheney>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, bfulgham, cdumez, cgarcia, ews-watchlist, wilander, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch for landing
none
Patch for landing none

Description Kate Cheney 2020-03-18 13:02:03 PDT
Currently this parameter is only being passed to the NetworkLoad object in NetworkResourceLoader::startNetworkLoad(). This is not the only way to load resources, so isNavigatingToAppBoundDomain should be updated to reflect that.
Comment 1 Kate Cheney 2020-03-18 13:02:37 PDT
<rdar://problem/60552712>
Comment 2 Kate Cheney 2020-03-18 13:24:34 PDT
Created attachment 393895 [details]
Patch
Comment 3 John Wilander 2020-03-18 13:32:39 PDT
Comment on attachment 393895 [details]
Patch

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

> Source/WebKit/Shared/NavigatingToAppBoundDomain.h:42
> +};

We don't need EnumTraits for boolean enum classes.

> Source/WebKit/Shared/PolicyDecision.h:104
>  template<> struct EnumTraits<WebKit::NavigatedAwayFromAppBoundDomain> {

You should be able to remove this one too but that's untreated to this patch.
Comment 4 John Wilander 2020-03-18 13:33:04 PDT
(In reply to John Wilander from comment #3)
> Comment on attachment 393895 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=393895&action=review
> 
> > Source/WebKit/Shared/NavigatingToAppBoundDomain.h:42
> > +};
> 
> We don't need EnumTraits for boolean enum classes.
> 
> > Source/WebKit/Shared/PolicyDecision.h:104
> >  template<> struct EnumTraits<WebKit::NavigatedAwayFromAppBoundDomain> {
> 
> You should be able to remove this one too but that's untreated to this patch.

*unrelated
Comment 5 Brent Fulgham 2020-03-18 13:42:55 PDT
Comment on attachment 393895 [details]
Patch

I think the overall approach of this patch seems good. I'll check with Chris or Alex to see if they have any other concerns.
Comment 6 Chris Dumez 2020-03-18 14:18:47 PDT
I defer to Alex or Youenn here.
Comment 7 Alex Christensen 2020-03-18 14:30:42 PDT
Comment on attachment 393895 [details]
Patch

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

I think the name NavigatingToAppBoundDomain is no longer correct, but I'm ok with it in this patch as long as there's a plan to rename it.
r=me

> Source/WebKit/Shared/NavigatingToAppBoundDomain.h:36
> +template<> struct EnumTraits<WebKit::NavigatingToAppBoundDomain> {

Yes, I agree with John.  Please remove this unneeded bit.

> Source/WebKit/WebProcess/WebPage/WebFrame.cpp:307
> +    webProcess.ensureNetworkProcessConnection().connection().send(Messages::NetworkConnectionToWebProcess::ConvertMainResourceLoadToDownload(mainResourceLoadIdentifier, policyDownloadID, request, response, page()->isNavigatingToAppBoundDomain()), 0);

We should probably null check page here and above.
Comment 8 Kate Cheney 2020-03-18 14:48:00 PDT
Created attachment 393907 [details]
Patch for landing
Comment 9 Kate Cheney 2020-03-18 14:49:20 PDT
(In reply to Alex Christensen from comment #7)
> Comment on attachment 393895 [details]
> Patch
> 

Thanks Alex! This patch has the changes you and John suggested. I will create a radar to rename isNavigatingToAppBoundDomain.
Comment 10 Kate Cheney 2020-03-18 15:36:40 PDT
Created attachment 393910 [details]
Patch for landing
Comment 11 EWS 2020-03-18 16:09:59 PDT
Committed r258667: <https://trac.webkit.org/changeset/258667>

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