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

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: Another clean-up 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 a746fd4e47389586a4876b795ab84bad6cf533fb..3211653238e3b7489b32fbd06c1f17b03a76d50d 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -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