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

Issue 2485513003: Rename JavaObjectWeakGlobalRef::is_empty to avoid misuse. (Closed)

Created:
4 years, 1 month ago by Torne
Modified:
4 years, 1 month ago
Reviewers:
rmcilroy, sky, timvolodine, boliu
CC:
chromium-reviews, jam, darin-cc_chromium.org, android-webview-reviews_chromium.org, agrieve+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Rename JavaObjectWeakGlobalRef::is_empty to avoid misuse. JavaObjectWeakGlobalRef::is_empty was being misused to attempt to check if the object referred to has been collected or not (see crbug.com/661444 for one case; others in this CL). The method is valuable in some cases that actually just want to check if the weak reference has been initialised, so rename it to is_uninitialized and add an explanatory comment to make it more obvious what to do with it. Fix a couple of existing uses that are incorrect or dubious, and rename the "okay" uses to call the new function. BUG= Committed: https://crrev.com/aef040326a50569a1838d2df24b636a90f8179f1 Cr-Commit-Position: refs/heads/master@{#430417}

Patch Set 1 #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+13 lines, -10 lines) Patch
M android_webview/native/aw_contents_io_thread_client_impl.cc View 1 chunk +3 lines, -4 lines 4 comments Download
M android_webview/native/popup_touch_handle_drawable.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/android/jni_weak_ref.h View 1 chunk +5 lines, -1 line 0 comments Download
M content/browser/android/java/gin_java_bridge_dispatcher_host.cc View 1 chunk +1 line, -1 line 0 comments Download
M content/browser/android/java/gin_java_method_invocation_helper.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/platform_window/android/platform_ime_controller_android.cc View 1 chunk +1 line, -1 line 0 comments Download
M ui/platform_window/android/platform_window_android.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 20 (4 generated)
Torne
rmcilroy: general review of the CL sky: OWNERS for ui timvolodine: checking that my change ...
4 years, 1 month ago (2016-11-07 15:14:25 UTC) #2
Torne
Also +boliu who originally commented on this API being weird/bad.
4 years, 1 month ago (2016-11-07 15:15:32 UTC) #4
rmcilroy
base/ LGTM
4 years, 1 month ago (2016-11-07 16:12:14 UTC) #5
timvolodine
On 2016/11/07 15:14:25, Torne wrote: > rmcilroy: general review of the CL > sky: OWNERS ...
4 years, 1 month ago (2016-11-07 16:31:20 UTC) #6
boliu
lgtm
4 years, 1 month ago (2016-11-07 16:34:39 UTC) #7
Torne
On 2016/11/07 16:31:20, timvolodine wrote: > On 2016/11/07 15:14:25, Torne wrote: > > rmcilroy: general ...
4 years, 1 month ago (2016-11-07 16:52:41 UTC) #8
timvolodine
https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc File android_webview/native/aw_contents_io_thread_client_impl.cc (right): https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc#newcode279 android_webview/native/aw_contents_io_thread_client_impl.cc:279: if (java_delegate.is_null()) to be more precise, I was looking ...
4 years, 1 month ago (2016-11-07 17:13:02 UTC) #9
boliu
https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc File android_webview/native/aw_contents_io_thread_client_impl.cc (right): https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc#newcode279 android_webview/native/aw_contents_io_thread_client_impl.cc:279: if (java_delegate.is_null()) On 2016/11/07 17:13:01, timvolodine wrote: > to ...
4 years, 1 month ago (2016-11-07 17:23:33 UTC) #10
boliu
https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc File android_webview/native/aw_contents_io_thread_client_impl.cc (right): https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc#newcode279 android_webview/native/aw_contents_io_thread_client_impl.cc:279: if (java_delegate.is_null()) On 2016/11/07 17:23:33, boliu wrote: > On ...
4 years, 1 month ago (2016-11-07 17:25:29 UTC) #11
timvolodine
On 2016/11/07 17:23:33, boliu wrote: > https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc > File android_webview/native/aw_contents_io_thread_client_impl.cc (right): > > https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc#newcode279 > ...
4 years, 1 month ago (2016-11-07 17:25:35 UTC) #12
timvolodine
On 2016/11/07 17:25:35, timvolodine wrote: > On 2016/11/07 17:23:33, boliu wrote: > > > https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc ...
4 years, 1 month ago (2016-11-07 17:26:48 UTC) #13
sky
LGTM
4 years, 1 month ago (2016-11-07 20:15:38 UTC) #14
timvolodine
https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc File android_webview/native/aw_contents_io_thread_client_impl.cc (right): https://codereview.chromium.org/2485513003/diff/1/android_webview/native/aw_contents_io_thread_client_impl.cc#newcode279 android_webview/native/aw_contents_io_thread_client_impl.cc:279: if (java_delegate.is_null()) On 2016/11/07 17:25:29, boliu wrote: > On ...
4 years, 1 month ago (2016-11-07 20:16:15 UTC) #15
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/2485513003/1
4 years, 1 month ago (2016-11-07 22:39:35 UTC) #17
commit-bot: I haz the power
Committed patchset #1 (id:1)
4 years, 1 month ago (2016-11-07 23:31:22 UTC) #18
commit-bot: I haz the power
4 years, 1 month ago (2016-11-07 23:43:37 UTC) #20
Message was sent while issue was closed.
Patchset 1 (id:??) landed as
https://crrev.com/aef040326a50569a1838d2df24b636a90f8179f1
Cr-Commit-Position: refs/heads/master@{#430417}

Powered by Google App Engine
This is Rietveld 408576698