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

Unified Diff: base/android/jni_android.cc

Issue 8769005: Don't use Singleton to cache JNI method IDs in Java Bridge (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 e6d6e56c2677c29f046c600bc34b7f833b6b32a3..dd4049c11252d46e0b21e5443189cae53ac2bd2a 100644
--- a/base/android/jni_android.cc
+++ b/base/android/jni_android.cc
@@ -47,10 +47,12 @@ jobject GetApplicationContext() {
return g_application_context;
}
-MethodID::MethodID(JNIEnv* env, const char* class_name, const char* method,
- const char* jni_signature) {
+jmethodID GetMethodIDFromClassName(JNIEnv* env,
+ const char* class_name,
+ const char* method,
+ const char* jni_signature) {
ScopedJavaLocalRef<jclass> clazz(env, env->FindClass(class_name));
M-A Ruel 2011/12/01 14:36:03 If you implement caching at this layer, you'll hav
Steve Block 2011/12/01 17:48:47 There's no need to cache JNIEnv (see above) and me
- id_ = GetMethodID(env, clazz.obj(), method, jni_signature);
+ return GetMethodID(env, clazz.obj(), method, jni_signature);
}
jmethodID GetMethodID(JNIEnv* env,

Powered by Google App Engine
This is Rietveld 408576698