Index: base/android/jni_android.h |
diff --git a/base/android/jni_android.h b/base/android/jni_android.h |
index 0e7b5574d8e445c0592074268c119a255722011c..858d8e420334ec7f4614eab3f3f00648617887be 100644 |
--- a/base/android/jni_android.h |
+++ b/base/android/jni_android.h |
@@ -9,6 +9,10 @@ |
#include <sys/types.h> |
#include "base/android/scoped_java_ref.h" |
+#include "base/compiler_specific.h" |
+ |
+// Used to mark symbols to be exported in a shared library's symbol table. |
+#define JNI_EXPORT __attribute__ ((visibility("default"))) |
Mark Mentovai
2012/03/06 22:02:30
Unused?
bulach
2012/03/07 11:04:24
ops. this will be upstreamed soon, removed for now
|
namespace base { |
namespace android { |
@@ -40,6 +44,10 @@ const jobject GetApplicationContext(); |
// Use HasClass if you need to check whether the class exists. |
ScopedJavaLocalRef<jclass> GetClass(JNIEnv* env, const char* class_name); |
+// Similar to the above, but the caller is responsible to manage the jclass |
+// lifetime. |
+jclass GetUnscopedClass(JNIEnv* env, const char* class_name) WARN_UNUSED_RESULT; |
+ |
// Returns true iff the class |class_name| could be found. |
bool HasClass(JNIEnv* env, const char* class_name); |
@@ -51,6 +59,12 @@ jmethodID GetMethodID(JNIEnv* env, |
const char* method_name, |
const char* jni_signature); |
+// Similar to GetMethodID, but takes a raw jclass. |
+jmethodID GetMethodID(JNIEnv* env, |
+ 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. |
@@ -60,6 +74,13 @@ jmethodID GetStaticMethodID(JNIEnv* env, |
const char* method_name, |
const char* jni_signature); |
+// Similar to the GetStaticMethodID, but takes a raw jclass. |
+jmethodID GetStaticMethodID(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, |
const JavaRef<jclass>& clazz, |