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

Unified Diff: base/android/jni_weak_ref.h

Issue 2480203002: ui: Cleanup class/struct forward declarations (Closed)
Patch Set: Sync CL to position 430550 Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/android/java/src/org/chromium/base/metrics/RecordHistogram.java ('k') | base/mac/scoped_nsobject.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_weak_ref.h
diff --git a/base/android/jni_weak_ref.h b/base/android/jni_weak_ref.h
index 2ae5cce02755c2833a2ab97acd71428a63cec2a5..223c47b2a2a5bd2fd10d392b0e2517a61ebb6267 100644
--- a/base/android/jni_weak_ref.h
+++ b/base/android/jni_weak_ref.h
@@ -29,7 +29,11 @@ class BASE_EXPORT JavaObjectWeakGlobalRef {
base::android::ScopedJavaLocalRef<jobject> get(JNIEnv* env) const;
- bool is_empty() const { return obj_ == nullptr; }
+ // Returns true if the weak reference has not been initialized to point at
+ // an object (or ḣas had reset() called).
+ // Do not call this to test if the object referred to still exists! The weak
+ // reference remains initialized even if the target object has been collected.
+ bool is_uninitialized() const { return obj_ == nullptr; }
void reset();
« no previous file with comments | « base/android/java/src/org/chromium/base/metrics/RecordHistogram.java ('k') | base/mac/scoped_nsobject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698