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

Issue 2538463002: android: Don't pass ScopedJavaGlobalRef pointers. (Closed)

Created:
4 years ago by Torne
Modified:
4 years ago
CC:
chromium-reviews, jam, darin-cc_chromium.org, android-webview-reviews_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

android: Don't pass ScopedJavaGlobalRef pointers. Various code was passing pointers to heap-allocated ScopedJavaGlobalRef objects in order to pass Java objects between threads. Having heap-allocated smart pointer types is very weird and not a desirable pattern. base::Bind handles rvalues correctly (they become owned by the callback) and so the nicer alternative is to simply pass temporary ScopedJavaGlobalRef parameters, which will automatically be deleted when the callback is deleted. The receiving function can take a const reference to JavaRef as its parameter type, which matches how direct function calls typically take Java object parameters and makes this look much more consistent. ScopedJavaGlobalRef is movable, so using std::mode is also an option, but all the cases in this CL simply construct temporaries. BUG=519562 Committed: https://crrev.com/d2b4c5dac132d311691be5818b44f2abdf238749 Cr-Commit-Position: refs/heads/master@{#435593}

Patch Set 1 #

Patch Set 2 : Reupload due to timeout #

Patch Set 3 : Reupload #2 due to timeout :( #

Patch Set 4 : timeouts are very annoying #

Unified diffs Side-by-side diffs Delta from patch set Stats (+101 lines, -135 lines) Patch
M android_webview/native/aw_contents.cc View 4 chunks +7 lines, -10 lines 0 comments Download
M android_webview/native/aw_contents_statics.cc View 3 chunks +6 lines, -7 lines 0 comments Download
M chrome/browser/android/favicon_helper.cc View 4 chunks +7 lines, -9 lines 0 comments Download
M chrome/browser/android/feedback/connectivity_checker.cc View 3 chunks +8 lines, -15 lines 0 comments Download
M chrome/browser/android/feedback/screenshot_task.cc View 4 chunks +6 lines, -11 lines 0 comments Download
M chrome/browser/android/large_icon_bridge.cc View 4 chunks +6 lines, -10 lines 0 comments Download
M chrome/browser/android/preferences/pref_service_bridge.cc View 5 chunks +7 lines, -6 lines 0 comments Download
M components/dom_distiller/content/browser/distillable_page_utils_android.cc View 3 chunks +16 lines, -25 lines 0 comments Download
M content/browser/android/app_web_message_port_service_impl.h View 2 chunks +2 lines, -2 lines 0 comments Download
M content/browser/android/app_web_message_port_service_impl.cc View 6 chunks +7 lines, -8 lines 0 comments Download
M content/browser/web_contents/web_contents_android.h View 1 chunk +12 lines, -14 lines 0 comments Download
M content/browser/web_contents/web_contents_android.cc View 4 chunks +12 lines, -15 lines 0 comments Download
M content/public/browser/android/app_web_message_port_service.h View 2 chunks +5 lines, -3 lines 0 comments Download

Messages

Total messages: 12 (4 generated)
Torne
Hi Tommy, Ted, This fixes all the "simple" cases where ScopedJavaGlobalRef is being passed around ...
4 years ago (2016-11-28 18:09:14 UTC) #2
Ted C
lgtm
4 years ago (2016-11-28 18:44:22 UTC) #3
sgurun-gerrit only
On 2016/11/28 18:44:22, Ted C wrote: > lgtm I guess some of this code may ...
4 years ago (2016-11-30 17:22:22 UTC) #4
Torne
On 2016/11/30 17:22:22, sgurun wrote: > On 2016/11/28 18:44:22, Ted C wrote: > > lgtm ...
4 years ago (2016-11-30 17:28:00 UTC) #5
nyquist
lgtm
4 years ago (2016-11-30 22:30:28 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2538463002/60001
4 years ago (2016-12-01 10:41:17 UTC) #8
commit-bot: I haz the power
Committed patchset #4 (id:60001)
4 years ago (2016-12-01 11:18:43 UTC) #10
commit-bot: I haz the power
4 years ago (2016-12-01 11:20:27 UTC) #12
Message was sent while issue was closed.
Patchset 4 (id:??) landed as
https://crrev.com/d2b4c5dac132d311691be5818b44f2abdf238749
Cr-Commit-Position: refs/heads/master@{#435593}

Powered by Google App Engine
This is Rietveld 408576698