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

Unified Diff: base/android/jni_android.h

Issue 10996063: Android: adds Get(Static)MethodIDOrNULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OrNULL Created 8 years, 3 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 | base/android/jni_android.cc » ('j') | base/android/jni_android.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_android.h
diff --git a/base/android/jni_android.h b/base/android/jni_android.h
index 492f11ff90bbcafbd70a8a8f659287eddd94d23a..18ec3d7de96175b4398e0c962d9aaee21b4b96c0 100644
--- a/base/android/jni_android.h
+++ b/base/android/jni_android.h
@@ -71,6 +71,12 @@ jmethodID GetMethodID(JNIEnv* env,
const char* method_name,
const char* jni_signature);
+// Unlike GetMethodID, returns NULL if the method could not be found.
+jmethodID GetMethodIDOrNULL(JNIEnv* env,
Sami 2012/10/01 11:32:15 Nit: GetMethodIDOrNull would be more consistent wi
bulach 2012/10/01 15:08:37 Done.
+ jclass clazz,
+ const char* method_name,
+ const char* jni_signature);
+
// Returns the method ID for the static method with the specified name and
// signature.
// This method triggers a fatal assertion if the method could not be found.
@@ -86,6 +92,12 @@ jmethodID GetStaticMethodID(JNIEnv* env,
const char* method_name,
const char* jni_signature);
+// Unlike GetStaticMethodID, returns NULL if the method could not be found.
+jmethodID GetStaticMethodIDOrNULL(JNIEnv* env,
+ jclass clazz,
+ const char* method_name,
+ const char* jni_signature);
+
// Returns true iff |clazz| has a method with the specified name and signature.
bool HasMethod(JNIEnv* env,
« no previous file with comments | « no previous file | base/android/jni_android.cc » ('j') | base/android/jni_android.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698