Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(117)

Issue 1432083004: [Android WebView] Fire onPageFinished from WebContentsObserver::didStopLoading (Closed)

Created:
5 years, 1 month ago by mnaganov (inactive)
Modified:
5 years, 1 month ago
Reviewers:
Ted C, gsennton
CC:
chromium-reviews, android-webview-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android WebView] Fire onPageFinished from WebContentsObserver::didStopLoading After CL https://codereview.chromium.org/1381003004, WebContentsObserver::didStopLoading has become the last event fired when loading is finished. WebView was using WebContentsObserver::didFinishLoad event when it is fired for the main frame, but this callback now happens before WebContentsImpl has updated its internal state. This causes subtle race issues, e.g. unwanted reloading of the currently loading page due to UA string update, which caused flakiness of AwSettingsTest#testUserAgentStringOverrideForHistory test. However, as didStopLoading is fired in some cases when didFinishLoad isn't, we still need to use didFinishLoad to gate posting of onPageFinishedEvent. BUG=553762 Committed: https://crrev.com/8f1314f6d90ebcc24506cd036e76f98c3881e8ba Cr-Commit-Position: refs/heads/master@{#359642}

Patch Set 1 #

Patch Set 2 : Post callback from didStopLoading only if had didFinishLoad before #

Patch Set 3 : Fix loadDataWithBaseUrl case #

Patch Set 4 : Fixed AwWebContentsObserverTest#testOnPageFinished #

Total comments: 6

Patch Set 5 : Comments addressed #

Patch Set 6 : Update WebContentsObserverProxy for extracting base url in both cases #

Patch Set 7 : Restore required AwWebContentsObserverTest changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+43 lines, -12 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java View 1 3 4 5 2 chunks +25 lines, -6 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwWebContentsObserverTest.java View 1 2 3 4 5 6 4 chunks +4 lines, -0 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/android/web_contents_observer_proxy.cc View 1 2 3 4 5 3 chunks +13 lines, -6 lines 0 comments Download

Messages

Total messages: 19 (9 generated)
mnaganov (inactive)
5 years, 1 month ago (2015-11-12 16:36:42 UTC) #3
gsennton
As is made clear by my comments here, I am not familiar with every part ...
5 years, 1 month ago (2015-11-13 02:35:39 UTC) #5
mnaganov (inactive)
Thanks! https://codereview.chromium.org/1432083004/diff/60001/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java File android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java (right): https://codereview.chromium.org/1432083004/diff/60001/android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java#newcode56 android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java:56: String currentUrl = awContents != null ? awContents.getUrl() ...
5 years, 1 month ago (2015-11-13 17:41:37 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1432083004/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1432083004/80001
5 years, 1 month ago (2015-11-13 17:42:00 UTC) #9
mnaganov (inactive)
On 2015/11/13 17:42:00, commit-bot: I haz the power wrote: > CQ is trying da patch. ...
5 years, 1 month ago (2015-11-13 17:46:49 UTC) #11
mnaganov (inactive)
Hi Ted, Please take a look at the WebContentsObserverProxy change. I have found out that ...
5 years, 1 month ago (2015-11-13 19:23:07 UTC) #13
Ted C
lgtm
5 years, 1 month ago (2015-11-13 19:39:06 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1432083004/80002 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1432083004/80002
5 years, 1 month ago (2015-11-13 20:47:04 UTC) #17
commit-bot: I haz the power
Committed patchset #7 (id:80002)
5 years, 1 month ago (2015-11-13 21:15:42 UTC) #18
commit-bot: I haz the power
5 years, 1 month ago (2015-11-13 21:17:11 UTC) #19
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/8f1314f6d90ebcc24506cd036e76f98c3881e8ba
Cr-Commit-Position: refs/heads/master@{#359642}

Powered by Google App Engine
This is Rietveld 408576698