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

Issue 2231923002: Make GetApplicationContext return a JavaRef. (Closed)

Created:
4 years, 4 months ago by Torne
Modified:
4 years, 4 months ago
CC:
chromium-reviews, posciak+watch_chromium.org, jam, avayvod+watch_chromium.org, dcheng, feature-media-reviews_chromium.org, darin-cc_chromium.org, mcasas+watch+vc_chromium.org, android-webview-reviews_chromium.org, mlamouri+watch-media_chromium.org, miu+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make GetApplicationContext return a JavaRef. Instead of returning a bare jobject, return a const reference to a JavaRef, making it clearer that the caller does not receive ownership. Most uses pass the result directly to a Java method; update the cases which store it in a variable or pass it elsewhere. Also, clean up the code surrounding the GetApplicationContext calls a bit: - There's no need to DCHECK this or AttachCurrentThread as the implementations already do that internally - Change method parameters that take contexts as jobject to JavaRef, and also other parameters of those methods where reasonable. BUG=506850 Committed: https://crrev.com/314ad6c309924d08e12a66a90c1b07558ad75c50 Cr-Commit-Position: refs/heads/master@{#412219}

Patch Set 1 #

Patch Set 2 : Also fix not-currently-compiled unit test #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -88 lines) Patch
M android_webview/native/android_protocol_handler.cc View 1 chunk +1 line, -6 lines 0 comments Download
M base/android/context_utils.h View 1 chunk +1 line, -1 line 0 comments Download
M base/android/context_utils.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/invalidation/invalidation_service_factory_android.h View 2 chunks +5 lines, -5 lines 0 comments Download
M chrome/browser/invalidation/invalidation_service_factory_android.cc View 3 chunks +6 lines, -10 lines 0 comments Download
M components/invalidation/impl/invalidation_service_android.h View 1 chunk +2 lines, -1 line 0 comments Download
M components/invalidation/impl/invalidation_service_android.cc View 1 chunk +4 lines, -3 lines 0 comments Download
M content/browser/android/composited_touch_handle_drawable.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/media/android/media_resource_getter_impl.cc View 3 chunks +3 lines, -1 line 0 comments Download
M media/base/android/media_player_android.h View 2 chunks +2 lines, -1 line 0 comments Download
M media/base/android/media_player_android.cc View 2 chunks +7 lines, -5 lines 0 comments Download
M media/base/android/media_player_bridge.cc View 4 chunks +4 lines, -3 lines 0 comments Download
M media/base/android/media_player_listener.h View 1 chunk +22 lines, -18 lines 0 comments Download
M media/base/android/media_player_listener.cc View 3 chunks +4 lines, -2 lines 0 comments Download
M media/base/android/media_source_player.cc View 1 chunk +1 line, -1 line 0 comments Download
M media/capture/video/android/video_capture_device_factory_android.cc View 2 chunks +3 lines, -1 line 0 comments Download
M ui/android/window_android.cc View 2 chunks +2 lines, -1 line 0 comments Download
M ui/base/clipboard/clipboard_android.cc View 1 chunk +2 lines, -8 lines 0 comments Download
M ui/base/clipboard/clipboard_android_unittest.cc View 1 2 chunks +2 lines, -4 lines 1 comment Download
M ui/base/touch/touch_device_android.cc View 3 chunks +9 lines, -14 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 23 (8 generated)
Torne
Hi, this is part of my ongoing effort to use JavaRef instead of bare objects. ...
4 years, 4 months ago (2016-08-11 11:26:57 UTC) #6
mcasas
On 2016/08/11 11:26:57, Torne wrote: > Hi, this is part of my ongoing effort to ...
4 years, 4 months ago (2016-08-11 14:58:30 UTC) #7
Yaron
content/browser/android lgtm
4 years, 4 months ago (2016-08-11 15:06:31 UTC) #8
rmcilroy
lgtm
4 years, 4 months ago (2016-08-11 15:54:39 UTC) #9
nyquist
chrome/browser/invalidation, components/invalidation lgtm
4 years, 4 months ago (2016-08-11 23:25:11 UTC) #10
sadrul
Can you add a ui/android owner to review the other changes in ui/ too? I ...
4 years, 4 months ago (2016-08-12 15:12:18 UTC) #11
Torne
+twellington to review ui/ stuff as per sadrul@ comment
4 years, 4 months ago (2016-08-12 15:38:05 UTC) #13
qinmin
lgtm
4 years, 4 months ago (2016-08-12 16:46:41 UTC) #14
Theresa
lgtm % one comment https://codereview.chromium.org/2231923002/diff/20001/ui/base/clipboard/clipboard_android_unittest.cc File ui/base/clipboard/clipboard_android_unittest.cc (left): https://codereview.chromium.org/2231923002/diff/20001/ui/base/clipboard/clipboard_android_unittest.cc#oldcode48 ui/base/clipboard/clipboard_android_unittest.cc:48: ASSERT_TRUE(context); Why is this check ...
4 years, 4 months ago (2016-08-15 17:54:14 UTC) #15
Torne
It was never necessary; GetApplicationContext already asserts that the context is set. On Mon, 15 ...
4 years, 4 months ago (2016-08-15 18:32:02 UTC) #16
Theresa
On 2016/08/15 18:32:02, Torne wrote: > It was never necessary; GetApplicationContext already asserts that the ...
4 years, 4 months ago (2016-08-15 18:32:47 UTC) #17
sadrul
rs lgtm
4 years, 4 months ago (2016-08-15 18:33:01 UTC) #18
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/2231923002/20001
4 years, 4 months ago (2016-08-16 11:09:18 UTC) #20
commit-bot: I haz the power
Committed patchset #2 (id:20001)
4 years, 4 months ago (2016-08-16 12:21:26 UTC) #21
commit-bot: I haz the power
4 years, 4 months ago (2016-08-16 12:22:59 UTC) #23
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/314ad6c309924d08e12a66a90c1b07558ad75c50
Cr-Commit-Position: refs/heads/master@{#412219}

Powered by Google App Engine
This is Rietveld 408576698