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

Unified Diff: base/android/jni_android.cc

Issue 1955573002: 🐝 Convert a few CHECKs to LOG(FATAL) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_android.cc
diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc
index 4db428ebf94786e6676ffd5e675166fa9475f21a..c342218bf4563f3a67048be9eba22b21127ce265 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -119,7 +119,9 @@ ScopedJavaLocalRef<jclass> GetClass(JNIEnv* env, const char* class_name) {
} else {
clazz = env->FindClass(class_name);
}
- CHECK(!ClearException(env) && clazz) << "Failed to find class " << class_name;
+ if (ClearException(env) || !clazz) {
+ LOG(FATAL) << "Failed to find class " << class_name;
+ }
return ScopedJavaLocalRef<jclass>(env, clazz);
}
@@ -156,10 +158,11 @@ jmethodID MethodID::Get(JNIEnv* env,
jmethodID id = type == TYPE_STATIC ?
env->GetStaticMethodID(clazz, method_name, jni_signature) :
env->GetMethodID(clazz, method_name, jni_signature);
- CHECK(base::android::ClearException(env) || id) <<
Yaron 2016/05/05 17:08:30 Am I crazy? Wasn't this inverted?
Torne 2016/05/05 17:33:22 Yes, this was inverted, you aren't crazy. It just
- "Failed to find " <<
- (type == TYPE_STATIC ? "static " : "") <<
- "method " << method_name << " " << jni_signature;
+ if (base::android::ClearException(env) || !id) {
+ LOG(FATAL) << "Failed to find " <<
+ (type == TYPE_STATIC ? "static " : "") <<
+ "method " << method_name << " " << jni_signature;
+ }
return id;
}
@@ -230,7 +233,7 @@ void CheckException(JNIEnv* env) {
}
// Now, feel good about it and die.
- CHECK(false) << "Please include Java exception stack in crash report";
+ LOG(FATAL) << "Please include Java exception stack in crash report";
}
std::string GetJavaExceptionInfo(JNIEnv* env, jthrowable java_throwable) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698