OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_ANDROID_JNI_ANDROID_H_ | 5 #ifndef BASE_ANDROID_JNI_ANDROID_H_ |
6 #define BASE_ANDROID_JNI_ANDROID_H_ | 6 #define BASE_ANDROID_JNI_ANDROID_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 | 10 |
11 #include "base/android/scoped_java_ref.h" | 11 #include "base/android/scoped_java_ref.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 const char* const method, | 60 const char* const method, |
61 const char* const jni_signature); | 61 const char* const jni_signature); |
62 | 62 |
63 // Gets the field ID for a class field. Clears the pending Java exception and | 63 // Gets the field ID for a class field. Clears the pending Java exception and |
64 // returns NULL if the field is not found. | 64 // returns NULL if the field is not found. |
65 jfieldID GetFieldID(JNIEnv* env, | 65 jfieldID GetFieldID(JNIEnv* env, |
66 jclass clazz, | 66 jclass clazz, |
67 const char* field, | 67 const char* field, |
68 const char* jni_signature); | 68 const char* jni_signature); |
69 | 69 |
70 // Returns true if an exception is pending in the provided JNIEnv*. If an | 70 // Returns true if an exception is pending in the provided JNIEnv*. |
71 // exception is pending, this function prints and then clears it. | 71 bool HasException(JNIEnv* env); |
72 bool CheckException(JNIEnv* env); | 72 |
| 73 // If an exception is pending in the provided JNIEnv*, this function clears it |
| 74 // and returns true. |
| 75 bool ClearException(JNIEnv* env); |
| 76 |
| 77 // This function will call CHECK() macro if there's any pending exception. |
| 78 void CheckException(JNIEnv* env); |
73 | 79 |
74 } // namespace android | 80 } // namespace android |
75 } // namespace base | 81 } // namespace base |
76 | 82 |
77 #endif // BASE_ANDROID_JNI_ANDROID_H_ | 83 #endif // BASE_ANDROID_JNI_ANDROID_H_ |
OLD | NEW |