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

Issue 1294333002: Fix wrong usages of ScopedJavaLocalRef::Release(). (Closed)

Created:
5 years, 4 months ago by Torne
Modified:
5 years, 3 months ago
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, cbentzel+watch_chromium.org, zea+watch_chromium.org, jam, dcheng, darin-cc_chromium.org, mkwst+moarreviews-shell_chromium.org, jochen+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix wrong usages of ScopedJavaLocalRef::Release(). Release() is used for transfer of ownership and indicates that the caller will take responsibility for deleting the local reference when it's done with it. This is not the right thing to use when calling Java functions, which do *not* take ownership of the local references you pass to them. Also clean up passing bare jobjects around in content shell; it's saner to always use ScopedJavaLocalRef. BUG=522014 Committed: https://crrev.com/b105fe36022d7664683839e0c961b770b2092554 Cr-Commit-Position: refs/heads/master@{#345903}

Patch Set 1 #

Patch Set 2 : Add comment to Release() explaining it should not be used to call java methods #

Unified diffs Side-by-side diffs Delta from patch set Stats (+38 lines, -53 lines) Patch
M base/android/java_handler_thread.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/android/scoped_java_ref.h View 1 2 chunks +4 lines, -2 lines 0 comments Download
M chrome/browser/android/history_report/history_report_jni_bridge.cc View 2 chunks +10 lines, -17 lines 0 comments Download
M chrome/browser/android/recently_closed_tabs_bridge.cc View 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/speech/tts_android.cc View 1 chunk +4 lines, -5 lines 0 comments Download
M components/cronet/android/test/test_upload_data_stream_handler.cc View 1 chunk +1 line, -1 line 0 comments Download
M components/gcm_driver/gcm_driver_android.cc View 2 chunks +6 lines, -8 lines 0 comments Download
M components/web_contents_delegate_android/web_contents_delegate_android.cc View 1 chunk +3 lines, -6 lines 0 comments Download
M content/shell/android/shell_manager.h View 1 chunk +1 line, -1 line 0 comments Download
M content/shell/android/shell_manager.cc View 1 chunk +3 lines, -5 lines 0 comments Download
M content/shell/browser/shell_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/base/clipboard/clipboard_android.cc View 1 chunk +2 lines, -4 lines 0 comments Download

Messages

Total messages: 18 (4 generated)
Torne
With this and my other CL to handle return types combined, all calls to Release() ...
5 years, 4 months ago (2015-08-18 12:18:51 UTC) #2
Torne
fgorski: components/gcm_driver/gcm_driver_android.cc dcheng: ui/base/clipboard/clipboard_android.cc tedchoc: chrome/browser/android/history_report/history_report_jni_bridge.cc chrome/browser/android/recently_closed_tabs_bridge.cc components/web_contents_delegate_android/web_contents_delegate_android.cc content/shell/android/shell_manager.cc content/shell/android/shell_manager.h content/shell/browser/shell_android.cc dmazzoni: chrome/browser/speech/tts_android.cc rmcilroy: base/android/java_handler_thread.cc ...
5 years, 4 months ago (2015-08-18 12:29:11 UTC) #4
Mike West
Drive-by LGTM for content/shell.
5 years, 4 months ago (2015-08-18 13:29:55 UTC) #5
rmcilroy
base/android LGTM.
5 years, 4 months ago (2015-08-18 13:46:24 UTC) #6
fgorski
components/gcm_driver lgtm
5 years, 4 months ago (2015-08-18 15:59:42 UTC) #7
Ted C
On 2015/08/18 15:59:42, fgorski wrote: > components/gcm_driver lgtm lgtm
5 years, 4 months ago (2015-08-21 17:11:30 UTC) #8
dmazzoni
chrome/browser/speech LGTM
5 years, 4 months ago (2015-08-24 19:06:17 UTC) #9
mef
components/cronet lgtm
5 years, 4 months ago (2015-08-24 19:32:28 UTC) #10
Torne
dcheng: ping
5 years, 4 months ago (2015-08-25 10:01:42 UTC) #11
Torne
sky, can I get a review for ui/ ?
5 years, 3 months ago (2015-08-27 12:04:34 UTC) #13
sky
LGTM
5 years, 3 months ago (2015-08-27 16:50:22 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1294333002/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1294333002/20001
5 years, 3 months ago (2015-08-27 16:52:12 UTC) #16
commit-bot: I haz the power
Committed patchset #2 (id:20001)
5 years, 3 months ago (2015-08-27 16:57:53 UTC) #17
commit-bot: I haz the power
5 years, 3 months ago (2015-08-27 16:58:34 UTC) #18
Message was sent while issue was closed.
Patchset 2 (id:??) landed as
https://crrev.com/b105fe36022d7664683839e0c961b770b2092554
Cr-Commit-Position: refs/heads/master@{#345903}

Powered by Google App Engine
This is Rietveld 408576698