New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 773608 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Bug



Sign in to add a comment

[PlzNavigate] investigate posting onPageStarted from the PlzNavigate shouldOverrideUrlLoading path

Project Member Reported by gsennton@chromium.org, Oct 11 2017

Issue description

we post onPageStart in the sync-ipc ShouldOverrideUrlLoading path here:
https://cs.chromium.org/chromium/src/android_webview/java/src/org/chromium/android_webview/AwContents.java?l=1&rcl=a3e6b4ed329668a56f6d97c126fc637054a39d2a

It is not clear that the logic for posting onPageStarted from that path is correct since the following CL landed 
https://chromium.googlesource.com/chromium/src/+/1ea0edbb6c8d845aa5d63d1298f591d74d26088c
and furthermore we should probably post onPageStarted from the new plzNavigate shouldOverrideUrlLoading path.


Next steps:
1. investigate why onPageStarted is posted from the shouldOverrideUrlLoading path, and what breaks if it's not posted
2. figure out whether the new plzNavigate path should also post onPageStarted
3. check why our existing onPageStarted instrumentation tests don't fail for plzNavigate (if they don't)
 
Cc: clamy@chromium.org ahemery@chromium.org jam@chromium.org nasko@chromium.org arthurso...@chromium.org
I asked myself the same question.
With PlzNavigate, the InterceptNavigationDelegateImpl is only used to post an onPageStarted event. If we want, we probably can remove the InterceptNavigationDelegateImpl and post onPageStarted just after calling ShouldOverrideUrlLoading in NavigationRequest::BeginNavigation().

There are a lot WebView tests that will fail if you don't post onPageStarted.

onPageStarted and onPageFinished are emitted only if shouldOverrideUrlLoading() return false for the initial navigation. It doesn't matter if shouldOverrideUrlLoading() returns false after a redirect.

FYI: I tried to move the WebView code out of content/ and put it in android_webview/
https://chromium-review.googlesource.com/c/chromium/src/+/697811.
It uses a NavigationThrottle. It could be used to post the onPageStarted event as well. But I had some issues with the onPageFinished one.
Right, I'm a bit confused when it comes to the case where PlzNavigate is turned on - in that case we will always post onPageStarted from InterceptNavigationDelegateImpl, while with the old code path we would only post onPageStarted if shouldOverrideUrlLoading returns false. Isn't that an unwanted behaviour change?

Comment 3 Deleted

With PlzNavigate, if ShouldOverrideUrlLoading return true in NavigationRequest::BeginNavigation(), we don't create a navigation (The navigation is represented by the NavigationHandle)
It means that the InterceptNavigationThrottle is not created. So it can't post a onPageStarted event.

The behavior is the same with/without PlzNavigate AFAIK
Ah ok, cool, would it be possible to add a comment about this somewhere for mere confused mortals like me? ;)
Yes, I was confused too when I was trying to fix issues with ShouldOverrideUrlLoading, a comment would be nice. I will add it if I make or see a patch about this soon or in a separate CL then.
Great, thanks!
Owner: arthurso...@chromium.org

Sign in to add a comment