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(); |