Bug 189012 - Make WebPageProxy always have a API::NavigationClient instead of always having a API::LoaderClient and API::PolicyClient
Summary: Make WebPageProxy always have a API::NavigationClient instead of always havin...
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: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-08-27 15:09 PDT by Alex Christensen
Modified: 2018-09-18 14:04 PDT (History)
8 users (show)

See Also:


Attachments
Patch (31.57 KB, patch)
2018-08-27 15:10 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (30.93 KB, patch)
2018-09-17 13:11 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (32.63 KB, patch)
2018-09-17 13:31 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (33.45 KB, patch)
2018-09-17 14:34 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (34.34 KB, patch)
2018-09-18 11:42 PDT, Alex Christensen
aestes: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2018-08-27 15:09:32 PDT
Make WebPageProxy always have a API::NavigationClient instead of always having a API::LoaderClient and API::PolicyClient
Comment 1 Alex Christensen 2018-08-27 15:10:38 PDT
Created attachment 348209 [details]
Patch
Comment 2 Alex Christensen 2018-09-17 13:11:19 PDT
Created attachment 349925 [details]
Patch
Comment 3 Alex Christensen 2018-09-17 13:31:44 PDT
Created attachment 349933 [details]
Patch
Comment 4 EWS Watchlist 2018-09-17 13:34:05 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 5 Alex Christensen 2018-09-17 14:34:44 PDT
Created attachment 349942 [details]
Patch
Comment 6 youenn fablet 2018-09-17 21:29:54 PDT
Comment on attachment 349942 [details]
Patch

Can the change log contain some explanations about the change of order between calls to NavigationClient and LoaderClient/PolicyClient.
In the case of navigation loads, it makes sense to me NavigationClient should be called even if LoaderClient is set.

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

> Source/WebKit/UIProcess/WebPageProxy.cpp:3492
>          m_loaderClient->didStartProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());

Isn't it a behavioral change here?
Previously, whenever we had a m_navigationClient, we were never calling m_loaderClient->didStartProvisionalLoadForFrame.
Shouldn't we revert the test so that we continue calling didStartProvisionalNavigation for main frames and call didStartProvisionalLoadForFrame for other frames if loader client is there?

> Source/WebKit/UIProcess/WebPageProxy.cpp:3525
> +        m_navigationClient->didReceiveServerRedirectForProvisionalNavigation(*this, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());

Ditto here and below.

> Source/WebKit/UIProcess/WebPageProxy.cpp:6922
> +    if (RefPtr<API::Data> keyData = m_navigationClient->webCryptoMasterKey(*this))

auto here and below.
Comment 7 Alex Christensen 2018-09-18 11:41:52 PDT
Comment on attachment 349942 [details]
Patch

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

>> Source/WebKit/UIProcess/WebPageProxy.cpp:3492
>>          m_loaderClient->didStartProvisionalLoadForFrame(*this, *frame, navigation.get(), m_process->transformHandlesToObjects(userData.object()).get());
> 
> Isn't it a behavioral change here?
> Previously, whenever we had a m_navigationClient, we were never calling m_loaderClient->didStartProvisionalLoadForFrame.
> Shouldn't we revert the test so that we continue calling didStartProvisionalNavigation for main frames and call didStartProvisionalLoadForFrame for other frames if loader client is there?

This is not a meaningful change in behavior.  All clients with a LoaderClient do not use a NavigationClient.  Preferring the LoaderClient just makes us not break those legacy clients until they migrate to using WKPageSetPageNavigationClient.  Modern clients use a NavigationClient, and this is making that the default without breaking legacy software.
Comment 8 Alex Christensen 2018-09-18 11:42:36 PDT
Created attachment 350036 [details]
Patch
Comment 9 Alex Christensen 2018-09-18 14:03:44 PDT
http://trac.webkit.org/r236154
Comment 10 Radar WebKit Bug Importer 2018-09-18 14:04:50 PDT
<rdar://problem/44574543>