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

Unified Diff: base/android/jni_android.h

Issue 9599010: JNI Bindings on Chrome for Android: unfork. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Mark's comment Created 8 years, 9 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') | no next file with comments »
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 0e7b5574d8e445c0592074268c119a255722011c..e483281dffb77e44afb327c35c82e19a33e0f60b 100644
--- a/base/android/jni_android.h
+++ b/base/android/jni_android.h
@@ -9,6 +9,7 @@
#include <sys/types.h>
#include "base/android/scoped_java_ref.h"
+#include "base/compiler_specific.h"
namespace base {
namespace android {
@@ -40,6 +41,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 +56,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 +71,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,
« no previous file with comments | « no previous file | base/android/jni_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698