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

Issue 786933005: [Android] Add proxy for Java-based WebContentsObservers (Closed)

Created:
6 years ago by jdduke (slow)
Modified:
5 years, 9 months ago
Reviewers:
Ted C, Yaron, boliu, gunsch
CC:
chromium-reviews, David Trainor- moved to gerrit, plundblad+watch_chromium.org, aboxhall+watch_chromium.org, jam, lcwu+watch_chromium.org, avayvod+watch_chromium.org, yuzo+watch_chromium.org, darin-cc_chromium.org, dmazzoni+watch_chromium.org, dtseng+watch_chromium.org, gunsch+watch_chromium.org, erikwright+watch_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] Add proxy for Java-based WebContentsObservers A good portion of the current WebContentsObserver instances for any given tab are Java-based. Each of these require separate JNI hops, as well as repeated string conversions, for each observer callback. Avoid such costs by having just one Java-based WebContentsObserverProxy that bridges from native and allows multiple Java-based WebContentsObserver subscribers. BUG=440134 Committed: https://crrev.com/c747fed0edbe60e29c6810314021210687577cd6 Cr-Commit-Position: refs/heads/master@{#319100}

Patch Set 1 #

Patch Set 2 : Undo change #

Patch Set 3 : Override #

Patch Set 4 : Getting carried away... WeakObserverList? #

Patch Set 5 : Cleanup #

Patch Set 6 : Rebase #

Patch Set 7 : Fix rebase #

Total comments: 1

Patch Set 8 : Fix build #

Total comments: 10

Patch Set 9 : First pass at non-weak ObserverList #

Patch Set 10 : Cleanup #

Patch Set 11 : Code review #

Total comments: 18

Patch Set 12 : Code review #

Total comments: 4

Patch Set 13 : Rebase #

Patch Set 14 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+488 lines, -917 lines) Patch
M android_webview/java/src/org/chromium/android_webview/AwContents.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +2 lines, -2 lines 0 comments Download
M android_webview/java/src/org/chromium/android_webview/AwWebContentsObserver.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/Tab.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +6 lines, -3 lines 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/VoiceSearchTabHelper.java View 1 chunk +1 line, -1 line 0 comments Download
M chrome/android/java/src/org/chromium/chrome/browser/WebsiteSettingsPopup.java View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +2 lines, -2 lines 0 comments Download
M chromecast/browser/android/apk/src/org/chromium/chromecast/shell/CastWindowAndroid.java View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/browser_jni_registrar.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +2 lines, -2 lines 0 comments Download
D content/browser/android/web_contents_observer_android.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -89 lines 0 comments Download
M content/browser/android/web_contents_observer_android.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +0 lines, -355 lines 0 comments Download
A + content/browser/android/web_contents_observer_proxy.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +9 lines, -11 lines 0 comments Download
A + content/browser/android/web_contents_observer_proxy.cc View 1 2 3 4 5 6 7 8 9 10 11 13 chunks +72 lines, -97 lines 0 comments Download
M content/content_browser.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +2 lines, -2 lines 0 comments Download
M content/content_jni.gypi View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +75 lines, -51 lines 0 comments Download
D content/public/android/java/src/org/chromium/content/browser/WebContentsObserver.java View 1 2 3 4 5 1 chunk +0 lines, -219 lines 0 comments Download
M content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsImpl.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +25 lines, -0 lines 0 comments Download
A content/public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +236 lines, -0 lines 0 comments Download
M content/public/android/java/src/org/chromium/content_public/browser/WebContents.java View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +14 lines, -0 lines 0 comments Download
A + content/public/android/java/src/org/chromium/content_public/browser/WebContentsObserver.java View 1 2 3 4 5 6 7 8 9 10 11 9 chunks +36 lines, -79 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/InterstitialPageTest.java View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M content/public/android/javatests/src/org/chromium/content/browser/WebContentsObserverAndroidTest.java View 1 chunk +1 line, -0 lines 0 comments Download
M content/public/test/android/javatests/src/org/chromium/content/browser/test/util/TestWebContentsObserver.java View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 27 (9 generated)
jdduke (slow)
tedchoc@: Any thoughts on this change? I've been sitting on it for a while, debating ...
5 years, 10 months ago (2015-02-18 19:47:30 UTC) #2
Ted C
I'm all for introducing the proxy, but I think the weak observer thing is overkill ...
5 years, 10 months ago (2015-02-18 22:54:37 UTC) #3
jdduke (slow)
https://codereview.chromium.org/786933005/diff/140001/content/browser/android/web_contents_observer_android.cc File content/browser/android/web_contents_observer_android.cc (right): https://codereview.chromium.org/786933005/diff/140001/content/browser/android/web_contents_observer_android.cc#newcode55 content/browser/android/web_contents_observer_android.cc:55: void WebContentsObserverAndroid::WebContentsDestroyed() { On 2015/02/18 22:54:36, Ted C wrote: ...
5 years, 10 months ago (2015-02-24 20:55:49 UTC) #4
Ted C
+yfriedman -- like to hear his thoughts on this but this lgtm...any idea how many ...
5 years, 10 months ago (2015-02-24 21:34:46 UTC) #6
jdduke (slow)
On 2015/02/24 21:34:46, Ted C wrote: > +yfriedman -- like to hear his thoughts on ...
5 years, 10 months ago (2015-02-24 21:36:37 UTC) #7
Yaron
I haven't looked through the whole change (can do, if you'd like) but I like ...
5 years, 10 months ago (2015-02-24 21:43:34 UTC) #8
Yaron
https://codereview.chromium.org/786933005/diff/200001/content/content_jni.gypi File content/content_jni.gypi (right): https://codereview.chromium.org/786933005/diff/200001/content/content_jni.gypi#newcode42 content/content_jni.gypi:42: 'public/android/java/src/org/chromium/content/browser/webcontents/WebContentsObserverProxy.java', I assume you have a downstream patch ready ...
5 years, 10 months ago (2015-02-25 16:39:33 UTC) #9
jdduke (slow)
https://codereview.chromium.org/786933005/diff/200001/content/browser/android/web_contents_observer_android.cc File content/browser/android/web_contents_observer_android.cc (right): https://codereview.chromium.org/786933005/diff/200001/content/browser/android/web_contents_observer_android.cc#newcode5 content/browser/android/web_contents_observer_android.cc:5: #include "content/browser/android/web_contents_observer_android.h" On 2015/02/24 21:34:46, Ted C wrote: > ...
5 years, 9 months ago (2015-02-26 21:22:10 UTC) #10
Yaron
lgtm https://codereview.chromium.org/786933005/diff/200001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java File content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java (right): https://codereview.chromium.org/786933005/diff/200001/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java#newcode285 content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java:285: // Using a weak reference avoids cycles that ...
5 years, 9 months ago (2015-02-27 19:34:57 UTC) #11
jdduke (slow)
+boliu for android_webview/ +gunsch for chromecast/ https://codereview.chromium.org/786933005/diff/220001/content/browser/android/web_contents_observer_proxy.cc File content/browser/android/web_contents_observer_proxy.cc (right): https://codereview.chromium.org/786933005/diff/220001/content/browser/android/web_contents_observer_proxy.cc#newcode25 content/browser/android/web_contents_observer_proxy.cc:25: // TODO(dcheng): File ...
5 years, 9 months ago (2015-03-03 17:05:17 UTC) #13
gunsch
On 2015/03/03 17:05:17, jdduke wrote: > +boliu for android_webview/ > +gunsch for chromecast/ > > ...
5 years, 9 months ago (2015-03-03 17:08:56 UTC) #14
boliu
android_webview rs lgtm
5 years, 9 months ago (2015-03-03 18:43:52 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/786933005/260001
5 years, 9 months ago (2015-03-04 17:17:14 UTC) #18
commit-bot: I haz the power
Try jobs failed on following builders: ios_dbg_simulator_ninja on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/ios_dbg_simulator_ninja/builds/2062) ios_rel_device_ninja on tryserver.chromium.mac (JOB_FAILED, ...
5 years, 9 months ago (2015-03-04 17:27:02 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/786933005/260001
5 years, 9 months ago (2015-03-04 17:28:56 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/786933005/260001
5 years, 9 months ago (2015-03-04 19:13:04 UTC) #25
commit-bot: I haz the power
Committed patchset #14 (id:260001)
5 years, 9 months ago (2015-03-04 19:39:03 UTC) #26
commit-bot: I haz the power
5 years, 9 months ago (2015-03-04 19:39:40 UTC) #27
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/c747fed0edbe60e29c6810314021210687577cd6
Cr-Commit-Position: refs/heads/master@{#319100}

Powered by Google App Engine
This is Rietveld 408576698