Bug 224311 - Add test infrastructure for app bound request context string
Summary: Add test infrastructure for app bound request context string
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Kate Cheney
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-04-07 16:34 PDT by Kate Cheney
Modified: 2021-04-08 15:15 PDT (History)
3 users (show)

See Also:


Attachments
Patch (22.77 KB, patch)
2021-04-07 16:35 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff
Patch (22.96 KB, patch)
2021-04-08 12:27 PDT, Kate Cheney
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Kate Cheney 2021-04-07 16:34:44 PDT
Add test infrastructure for app bound request context string
Comment 1 Kate Cheney 2021-04-07 16:35:59 PDT
Created attachment 425451 [details]
Patch
Comment 2 Brent Fulgham 2021-04-07 17:18:56 PDT
Comment on attachment 425451 [details]
Patch

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

> Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:60
> +static String contextString(NSURLRequest *) { return { }; }

What this returned a RegistrableDomain?

> LayoutTests/platform/ios-wk2/TestExpectations:1913
> +webkit.org/b/223750 [ Debug ] security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html [ Pass Crash ]

What a weird decision for your text editor to make!
Comment 3 Alex Christensen 2021-04-08 08:59:04 PDT
Comment on attachment 425451 [details]
Patch

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

> Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:697
> +    webPageProxy->appBoundNavigationData([registrableDomain = WebCore::RegistrableDomain::uncheckedCreateFromHost(domain), completionHandler = makeBlockPtr(completionHandler)] (auto&& appBoundData) mutable {

It seems like this SPI should be on WKKWebView instead of WKKWebsiteDataStore if all it does it call a function on the WebView's WebPageProxy.
Comment 4 Kate Cheney 2021-04-08 09:58:48 PDT
(In reply to Brent Fulgham from comment #2)
> Comment on attachment 425451 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=425451&action=review
> 
> > Source/WebKit/NetworkProcess/cocoa/NetworkDataTaskCocoa.mm:60
> > +static String contextString(NSURLRequest *) { return { }; }
> 
> What this returned a RegistrableDomain?
> 

That would probably be better, I'll make that change before landing.

> > LayoutTests/platform/ios-wk2/TestExpectations:1913
> > +webkit.org/b/223750 [ Debug ] security/contentSecurityPolicy/plugins-types-allows-youtube-plugin-replacement.html [ Pass Crash ]
> 
> What a weird decision for your text editor to make!

Oops, didn't notice that, will fix before landing.
Comment 5 Kate Cheney 2021-04-08 10:00:36 PDT
(In reply to Alex Christensen from comment #3)
> Comment on attachment 425451 [details]
> Patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=425451&action=review
> 
> > Source/WebKit/UIProcess/API/Cocoa/WKWebsiteDataStore.mm:697
> > +    webPageProxy->appBoundNavigationData([registrableDomain = WebCore::RegistrableDomain::uncheckedCreateFromHost(domain), completionHandler = makeBlockPtr(completionHandler)] (auto&& appBoundData) mutable {
> 
> It seems like this SPI should be on WKKWebView instead of
> WKKWebsiteDataStore if all it does it call a function on the WebView's
> WebPageProxy.

You're right. I was lazy and copied other SPIs in the file, which went through WKWebsiteDataStore to call WebPageProxy functions. Let me see if I can move it to WKWebView before landing.
Comment 6 Kate Cheney 2021-04-08 12:27:08 PDT
Created attachment 425530 [details]
Patch
Comment 7 Kate Cheney 2021-04-08 12:27:36 PDT
(In reply to katherine_cheney from comment #6)
> Created attachment 425530 [details]
> Patch

Awaiting EWS. Moved SPI to WKWebView instead of WKWebsiteDataStore based on Alex's comment.
Comment 8 EWS 2021-04-08 15:14:39 PDT
Committed r275682 (236317@main): <https://commits.webkit.org/236317@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 425530 [details].
Comment 9 Radar WebKit Bug Importer 2021-04-08 15:15:20 PDT
<rdar://problem/76424060>