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

Unified Diff: base/android/scoped_java_ref.cc

Issue 1308413003: Inline constructors/destructor for JavaRef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: also comment .cc file Created 5 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') | no next file » | 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 bb6f5032fe3454dfc2011c5a6a38c603714a84c5..4d4ef6da191ecba41239f0c7578f57d5e1204571 100644
--- a/base/android/scoped_java_ref.cc
+++ b/base/android/scoped_java_ref.cc
@@ -28,16 +28,15 @@ ScopedJavaLocalFrame::ScopedJavaLocalFrame(JNIEnv* env, int capacity)
ScopedJavaLocalFrame::~ScopedJavaLocalFrame() { env_->PopLocalFrame(NULL); }
-JavaRef<jobject>::JavaRef() : obj_(NULL) {}
-
+#if DCHECK_IS_ON()
+// This constructor is inlined when DCHECKs are disabled; don't add anything
+// else here.
JavaRef<jobject>::JavaRef(JNIEnv* env, jobject obj) : obj_(obj) {
if (obj) {
DCHECK(env && env->GetObjectRefType(obj) == JNILocalRefType);
}
}
-
-JavaRef<jobject>::~JavaRef() {
-}
+#endif
JNIEnv* JavaRef<jobject>::SetNewLocalRef(JNIEnv* env, jobject obj) {
if (!env) {
« no previous file with comments | « base/android/scoped_java_ref.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698