Bug 221641

Summary: Expand stubs to thread actual NSURLRequest/NSURLResponse for the new simulated-request API
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: WebKit Misc.Assignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, beidson, bfulgham, cdumez, ggaren, katherine_cheney, rniwa, webkit-bug-importer, youennf
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=222081
Bug Depends on: 221430    
Bug Blocks:    
Attachments:
Description Flags
Patch
ews-feeder: commit-queue-
Patch
ews-feeder: commit-queue-
Patch
none
Patch for landing
none
Patch none

Description Brent Fulgham 2021-02-09 16:56:33 PST
We established a set of stubs in Bug 221430 that need to be fleshed out.

1. They should thread the NSURLRequest/NSURLResponse objects to the loading layer (I think this is already true for NSURLRequest).
2. Loads via these API should cause entries to be added to the back/forward list.
3. We need API Tests to confirm the back/forward list works as expected.
Comment 1 Radar WebKit Bug Importer 2021-02-09 16:57:02 PST
<rdar://problem/74166568>
Comment 2 Brent Fulgham 2021-02-16 17:03:04 PST
Created attachment 420561 [details]
Patch
Comment 3 Brent Fulgham 2021-02-16 17:34:54 PST
Created attachment 420565 [details]
Patch
Comment 4 Brent Fulgham 2021-02-16 18:00:06 PST
Created attachment 420573 [details]
Patch
Comment 5 Brent Fulgham 2021-02-16 18:15:02 PST
Comment on attachment 420573 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:1501
> +void WebPageProxy::loadSimulatedRequestDataWithNavigationShared(Ref<WebProcessProxy>&& process, WebCore::PageIdentifier webPageID, API::Navigation& navigation, WebCore::ResourceRequest&& simulatedRequest, WebCore::ResourceResponse&& simulatedResponse, const IPC::DataReference& data, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, Optional<WebsitePoliciesData>&& websitePolicies, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy)

@Chris: I can merge this with the above if I don’t need to do a ProvisionalPageProxy.
Comment 6 Chris Dumez 2021-02-17 10:15:17 PST
Comment on attachment 420573 [details]
Patch

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

>> Source/WebKit/UIProcess/WebPageProxy.cpp:1501
>> +void WebPageProxy::loadSimulatedRequestDataWithNavigationShared(Ref<WebProcessProxy>&& process, WebCore::PageIdentifier webPageID, API::Navigation& navigation, WebCore::ResourceRequest&& simulatedRequest, WebCore::ResourceResponse&& simulatedResponse, const IPC::DataReference& data, API::Object* userData, ShouldTreatAsContinuingLoad shouldTreatAsContinuingLoad, Optional<NavigatingToAppBoundDomain> isNavigatingToAppBoundDomain, Optional<WebsitePoliciesData>&& websitePolicies, ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicy)
> 
> @Chris: I can merge this with the above if I don’t need to do a ProvisionalPageProxy.

Right. I think we should merge.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewLoadAPIs.mm:100
> +    EXPECT_EQ((NSUInteger)1, list.backList.count);

Would be good to check WKBackForwardListItem.URL too for both the current item and the backList item.

> Tools/TestWebKitAPI/Tests/WebKitCocoa/WKWebViewLoadAPIs.mm:111
> +    EXPECT_EQ((NSUInteger)1, list.forwardList.count);

ditto.
Comment 7 Kate Cheney 2021-02-17 10:16:52 PST
Comment on attachment 420573 [details]
Patch

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:1476
> +    UNUSED_PARAM(data);

Is this meant to be here? It seems like data is used below.
Comment 8 Brent Fulgham 2021-02-17 12:13:38 PST
Created attachment 420691 [details]
Patch for landing
Comment 9 EWS 2021-02-17 13:26:13 PST
Committed r273023: <https://commits.webkit.org/r273023>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 420691 [details].
Comment 10 Brent Fulgham 2021-02-17 14:59:53 PST
Reopening to add a test fix.
Comment 11 Brent Fulgham 2021-02-17 16:03:49 PST
Created attachment 420746 [details]
Patch
Comment 12 Chris Dumez 2021-02-17 16:05:28 PST
Comment on attachment 420746 [details]
Patch

r=me
Comment 13 EWS 2021-02-17 16:40:09 PST
Committed r273048: <https://commits.webkit.org/r273048>

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