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

Unified Diff: base/android/scoped_java_ref.cc

Issue 2219923002: JNI: allow either JavaRef or bare objects in Java calls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove unreachable line Created 4 years, 4 months 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/scoped_java_ref.h ('k') | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/scoped_java_ref.cc
diff --git a/base/android/scoped_java_ref.cc b/base/android/scoped_java_ref.cc
index 4d4ef6da191ecba41239f0c7578f57d5e1204571..7d31a75bc8f1fa933d3a2e25f99b110c904619ef 100644
--- a/base/android/scoped_java_ref.cc
+++ b/base/android/scoped_java_ref.cc
@@ -26,7 +26,9 @@ ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity)
DCHECK(!failed);
}
-ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { env_->PopLocalFrame(NULL); }
+ScopedJavaLocalFrame::~ScopedJavaLocalFrame() {
+ env_->PopLocalFrame(nullptr);
+}
#if DCHECK_IS_ON()
// This constructor is inlined when DCHECKs are disabled; don't add anything
@@ -69,20 +71,20 @@ void JavaRef<jobject>::ResetLocalRef(JNIEnv* env) {
if (obj_) {
DCHECK_EQ(env, AttachCurrentThread()); // Is |env| on correct thread.
env->DeleteLocalRef(obj_);
- obj_ = NULL;
+ obj_ = nullptr;
}
}
void JavaRef<jobject>::ResetGlobalRef() {
if (obj_) {
AttachCurrentThread()->DeleteGlobalRef(obj_);
- obj_ = NULL;
+ obj_ = nullptr;
}
}
jobject JavaRef<jobject>::ReleaseInternal() {
jobject obj = obj_;
- obj_ = NULL;
+ obj_ = nullptr;
return obj;
}
« no previous file with comments | « base/android/scoped_java_ref.h ('k') | chrome/browser/android/preferences/website_preference_bridge.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698