New issue
Advanced search Search tips

Issue 732244 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Jun 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 2
Type: Bug-Regression



Sign in to add a comment

WebViewClient.doUpdateVisitedHistory

Reported by anthonyo...@gmail.com, Jun 12 2017

Issue description

Steps to reproduce the problem:
1. Use WebViewClient.doUpdateVisitedHistory to listen for and print out visited URLs
2. In WebView, set URL to http://zeit.de/
3. doUpdateVisitedHistory is called for URL resources that are loaded, and not just top level navigation changes like in all previous versions of WebView

What is the expected behavior?
WebViewClient.doUpdateVisitedHistory should only be called once for http://www.zeit.de/

What went wrong?
WebViewClient.doUpdateVisitedHistory is called for resources too:
quit.zeit.de...
jobs.zeit.de...
ad13.adfarm1.addition.com...
facebook.com...
imagesrv.adition.com...
api.adrtx.net...
dmp.theadex.com...
c.t4ft.de...
about:blank
about:srcdoc

Did this work before? Yes It worked before, and not including 58.0.3029.83

Does this work in other browsers? N/A

Chrome version: 58.0.3029.83  Channel: n/a
OS Version: 7.1.2
Flash Version: n/a

This started with Chrome 58.0.3029.83 and is still present in Chrome Canary 61.0.3125.5
 
Components: Mobile>WebView
Cc: shaktisahu@chromium.org
Status: Available (was: Unconfirmed)
As far as I can tell the only CL that changed this behaviour around the 58 time-frame is this:
https://codereview.chromium.org/2642303002
where the postDoUpdateVisitedHistory call was moved from the callback didNavigateAnyFrame() (which itself was removed) into didFinishNavigation().

That CL landed in 58.0.3009.0.

shaktisahu@, when does didFinishNavigation() trigger? Does it trigger for sub-resources?
didFinishNavigation is triggered for every navigation.
The behavior should be exactly same as before, it would be triggered for each of frame in the page. I don't see a lot of iframes from the page source though. However if you want to change the behavior to do update the visited history only for the main frame, you can add isInMainFrame to the "if (hasCommitted && client != null)" check.

Comment 4 by torne@chromium.org, Jun 15 2017

Yup, the behaviour definitely changed in M58 here (tested by adding logging to webview shell). So either that CL is the culprit in which case it looks like the old didNavigateAnyFrame method was broken and was actually only being called for the main frame, or a different earlier CL broke it - but in any case, we should just check this ourselves before calling the callback since didNavigateMainFrame has been removed from the observer interface, so I don't think it matters too much which CL caused the change :)

Comment 5 by torne@chromium.org, Jun 15 2017

Owner: torne@chromium.org
Status: Started (was: Available)
Project Member

Comment 6 by bugdroid1@chromium.org, Jun 16 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/94021c7ec45a7226064a9f523dc161c58737f256

commit 94021c7ec45a7226064a9f523dc161c58737f256
Author: Torne (Richard Coles) <torne@google.com>
Date: Fri Jun 16 22:14:56 2017

Only call doUpdateVisitedHistory for the main frame.

Before M58 we only called WebViewClient.doUpdateVisitedHistory for main
frame navigations - at some point during navigation refactoring this
appears to have gotten broken. Move the early-exit for non-main-frame
URLs earlier in AwWebContentsObserver to restore the pre-M58 behaviour
and add test coverage for this case.

BUG= 732244 

Change-Id: I86c4a02180dffe6ceb9cad7590dc11cd0a40f2f8
Reviewed-on: https://chromium-review.googlesource.com/537512
Reviewed-by: Selim Gurun <sgurun@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#480196}
[modify] https://crrev.com/94021c7ec45a7226064a9f523dc161c58737f256/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
[modify] https://crrev.com/94021c7ec45a7226064a9f523dc161c58737f256/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
[modify] https://crrev.com/94021c7ec45a7226064a9f523dc161c58737f256/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java

Comment 7 by torne@chromium.org, Jun 19 2017

Labels: Merge-Request-60
Project Member

Comment 8 by sheriffbot@chromium.org, Jun 19 2017

Labels: -Merge-Request-60 Hotlist-Merge-Review Merge-Review-60
This bug requires manual review: M60 has already been promoted to the beta branch, so this requires manual review
Please contact the milestone owner if you have questions.
Owners: amineer@(Android), cmasso@(iOS), josafat@(ChromeOS), bustamante@(Desktop)

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Merge-Review-60 Merge-Approved-60
Merge approved for M60 branch 3112.  Please include context in the merge request next time though (e.g. "Fixes a regression reported by users, extraordinarily safe" etc) next time.
Please merge today so that it makes it into this week's Beta release.

Comment 11 by torne@chromium.org, Jun 21 2017

Apologies, missed the approval. Doing it now.
Project Member

Comment 12 by bugdroid1@chromium.org, Jun 21 2017

Labels: -merge-approved-60 merge-merged-3112
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/49ec2ff743401d812350dc8e27fb786b5e479957

commit 49ec2ff743401d812350dc8e27fb786b5e479957
Author: Torne (Richard Coles) <torne@google.com>
Date: Wed Jun 21 20:20:54 2017

Only call doUpdateVisitedHistory for the main frame.

Before M58 we only called WebViewClient.doUpdateVisitedHistory for main
frame navigations - at some point during navigation refactoring this
appears to have gotten broken. Move the early-exit for non-main-frame
URLs earlier in AwWebContentsObserver to restore the pre-M58 behaviour
and add test coverage for this case.

BUG= 732244 

Change-Id: I86c4a02180dffe6ceb9cad7590dc11cd0a40f2f8
Reviewed-on: https://chromium-review.googlesource.com/537512
Reviewed-by: Selim Gurun <sgurun@chromium.org>
Reviewed-by: Richard Coles <torne@chromium.org>
Commit-Queue: Richard Coles <torne@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#480196}
Review-Url: https://codereview.chromium.org/2950043004 .
Cr-Commit-Position: refs/branch-heads/3112@{#424}
Cr-Branched-From: b6460e24cf59f429d69de255538d0fc7a425ccf9-refs/heads/master@{#474897}

[modify] https://crrev.com/49ec2ff743401d812350dc8e27fb786b5e479957/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java
[modify] https://crrev.com/49ec2ff743401d812350dc8e27fb786b5e479957/android_webview/javatests/src/org/chromium/android_webview/test/AwContentsClientVisitedHistoryTest.java
[modify] https://crrev.com/49ec2ff743401d812350dc8e27fb786b5e479957/android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java

Comment 13 by torne@chromium.org, Jun 21 2017

Status: Fixed (was: Started)

Sign in to add a comment