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

Issue 970883002: [Android WebView] Synthesize a fake page loading event on page source modification (Re-land) (Closed)

Created:
5 years, 9 months ago by mnaganov (inactive)
Modified:
5 years, 9 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, avayvod+watch_chromium.org, jam, David Trainor- moved to gerrit, darin-cc_chromium.org, 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] Synthesize a fake page loading event on page source modification (Re-land) When a script modifies page source of a non-committed page, we need to notify clients, so they can update the URL bar to avoid confusion. New logic since the last attempt (https://codereview.chromium.org/924833003/): distinguish between a "vanilla" WebView state (basically, a newly created WebView, where no loading attempts have been made) and an "attempted to navigate" state. In the "vanilla" state, don't fire synthesized page loading events to avoid confusing clients. This is safe, as WebView is guaranteed to be on a blank page. Implementation note: we detect navigation attempts using didStartProvisionalLoadForFrame WebContentsObserver event on the Java side. As for popups AwWebContentsObserver gets re-attached from the original popup WebView to the one provided by the client, notifications issued inbetween can be missed on the Java side. To work around this, we assume that WebViews opened as popups can never be in "vanilla" state (as they are anyway opened as a result of navigation). BUG=458569, 462213 TBR=davidben@chromium.org,tedchoc@chromium.org Committed: https://crrev.com/b2803fd408c3709889645061fad42d3371024b93 Cr-Commit-Position: refs/heads/master@{#319061}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Comments addressed #

Patch Set 3 : Fixed findbugs warning #

Unified diffs Side-by-side diffs Delta from patch set Stats (+306 lines, -21 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 7 chunks +30 lines, -2 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegate.java View 1 chunk +4 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java View 3 chunks +18 lines, -0 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java View 1 2 chunks +16 lines, -0 lines 0 comments Download
M android_webview/java_library_common.mk View 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/AwTestBase.java View 1 2 3 chunks +22 lines, -3 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/ClientOnPageFinishedTest.java View 1 chunk +80 lines, -0 lines 0 comments Download
M android_webview/javatests/src/org/chromium/android_webview/test/PopupWindowTest.java View 1 2 chunks +26 lines, -2 lines 0 comments Download
M android_webview/libwebviewchromium.gypi View 1 chunk +1 line, -0 lines 0 comments Download
M android_webview/native/aw_web_contents_delegate.h View 1 chunk +2 lines, -0 lines 0 comments Download
M android_webview/native/aw_web_contents_delegate.cc View 1 chunk +12 lines, -0 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/Tab.java View 1 2 chunks +3 lines, -2 lines 0 comments Download
M components/web_contents_delegate_android/android/java/src/org/chromium/components/web_contents_delegate_android/WebContentsDelegateAndroid.java View 2 chunks +3 lines, -10 lines 0 comments Download
M content/browser/web_contents/web_contents_android.h View 2 chunks +4 lines, -0 lines 0 comments Download
M content/browser/web_contents/web_contents_android.cc View 2 chunks +15 lines, -0 lines 0 comments Download
M content/content.gyp View 2 chunks +9 lines, -0 lines 0 comments Download
M content/public/android/BUILD.gn View 2 chunks +2 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java View 4 chunks +13 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/WebContents.java View 2 chunks +16 lines, -0 lines 0 comments Download
M content/public/browser/invalidate_type.h View 1 chunk +5 lines, -0 lines 0 comments Download
M net/test/android/javatests/src/org/chromium/net/test/util/TestWebServer.java View 5 chunks +24 lines, -2 lines 0 comments Download

Messages

Total messages: 21 (7 generated)
mnaganov (inactive)
Charile, Torne, please re-consider the anit-spoof patch.
5 years, 9 months ago (2015-03-02 13:44:42 UTC) #2
Charlie Reis
Seems like there may be a simpler way than all the extra "vanilla" state tracking. ...
5 years, 9 months ago (2015-03-02 23:09:31 UTC) #3
mnaganov (inactive)
https://codereview.chromium.org/970883002/diff/1/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java File android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java (right): https://codereview.chromium.org/970883002/diff/1/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java#newcode221 android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java:221: && mAwContents.getDidAttemptLoad()) { On 2015/03/02 23:09:31, Charlie Reis wrote: ...
5 years, 9 months ago (2015-03-03 08:55:48 UTC) #4
Torne
Code in general LGTM; deferring to creis for final verdict about the approach though :)
5 years, 9 months ago (2015-03-03 15:01:08 UTC) #5
Charlie Reis
On 2015/03/03 08:55:48, mnaganov (cr) wrote: > https://codereview.chromium.org/970883002/diff/1/android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java > File > android_webview/java/src/org/chromium/android_webview/AwWebContentsDelegateAdapter.java > (right): > ...
5 years, 9 months ago (2015-03-03 20:12:50 UTC) #6
mnaganov (inactive)
On 2015/03/03 20:12:50, Charlie Reis wrote: > On 2015/03/03 08:55:48, mnaganov (cr) wrote: > > ...
5 years, 9 months ago (2015-03-03 21:21:14 UTC) #7
Charlie Reis
On 2015/03/03 21:21:14, mnaganov (cr) wrote: > You are right -- these notifications are indeed ...
5 years, 9 months ago (2015-03-03 22:21:01 UTC) #8
mnaganov (inactive)
Thanks, Charlie! https://codereview.chromium.org/970883002/diff/1/android_webview/java/src/org/chromium/android_webview/AwContents.java File android_webview/java/src/org/chromium/android_webview/AwContents.java (right): https://codereview.chromium.org/970883002/diff/1/android_webview/java/src/org/chromium/android_webview/AwContents.java#newcode913 android_webview/java/src/org/chromium/android_webview/AwContents.java:913: mDidAttemptLoad = true; On 2015/03/03 22:21:00, Charlie ...
5 years, 9 months ago (2015-03-04 10:30:29 UTC) #9
mnaganov (inactive)
davidben@, tedchoc@: TBR'ing you because nothing has changed since the last attempt in the code ...
5 years, 9 months ago (2015-03-04 10:36:26 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/970883002/20001
5 years, 9 months ago (2015-03-04 10:36:55 UTC) #14
commit-bot: I haz the power
Try jobs failed on following builders: android_arm64_dbg_recipe on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_arm64_dbg_recipe/builds/52929)
5 years, 9 months ago (2015-03-04 12:24:06 UTC) #16
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/970883002/40001
5 years, 9 months ago (2015-03-04 12:36:59 UTC) #19
commit-bot: I haz the power
Committed patchset #3 (id:40001)
5 years, 9 months ago (2015-03-04 13:42:11 UTC) #20
commit-bot: I haz the power
5 years, 9 months ago (2015-03-04 13:42:50 UTC) #21
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/b2803fd408c3709889645061fad42d3371024b93
Cr-Commit-Position: refs/heads/master@{#319061}

Powered by Google App Engine
This is Rietveld 408576698