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

Unified Diff: base/android/jni_android.cc

Issue 9264014: Upstream the clipboard implementation for Android (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed dcheng's comments Created 8 years, 11 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
Index: base/android/jni_android.cc
diff --git a/base/android/jni_android.cc b/base/android/jni_android.cc
index f99f1aba16677252e67b0c6e4268f14d0b397d71..9000e86bcaf372fd59f763d9b408df92bb64177b 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -157,13 +157,23 @@ jfieldID GetFieldID(JNIEnv* env,
return id;
}
-bool CheckException(JNIEnv* env) {
- if (env->ExceptionCheck() == JNI_FALSE)
+bool HasException(JNIEnv* env) {
+ return env->ExceptionCheck() != JNI_FALSE;
+}
+
+bool ClearException(JNIEnv* env) {
+ if (!HasException(env))
return false;
- env->ExceptionDescribe();
env->ExceptionClear();
return true;
}
+void CheckException(JNIEnv* env) {
+ if (HasException(env)) {
+ env->ExceptionDescribe();
+ CHECK(false);
+ }
+}
+
} // namespace android
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698