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

Unified Diff: webkit/glue/fling_animator_impl_android.cc

Issue 11038015: Android: lazy initialization for method id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moves to MethodID Created 8 years, 2 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
Index: webkit/glue/fling_animator_impl_android.cc
diff --git a/webkit/glue/fling_animator_impl_android.cc b/webkit/glue/fling_animator_impl_android.cc
index d663cb73d57f9d1cd45487cf3e9f2b38c6772e3c..3094a1f5e0c00f82de2bd51526c7ea6c1c8e89ff 100644
--- a/webkit/glue/fling_animator_impl_android.cc
+++ b/webkit/glue/fling_animator_impl_android.cc
@@ -18,18 +18,29 @@ FlingAnimatorImpl::FlingAnimatorImpl()
JNIEnv* env = AttachCurrentThread();
DCHECK(env);
ScopedJavaLocalRef<jclass> cls(GetClass(env, "android/widget/OverScroller"));
- jmethodID constructor = GetMethodID(env, cls, "<init>",
- "(Landroid/content/Context;)V");
+ jmethodID constructor = MethodID::Get<
joth 2012/10/04 17:59:59 should at least add the explicit 'using ..MethodI
bulach 2012/10/04 18:58:17 added the correct "using" above..
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "<init>", "(Landroid/content/Context;)V");
ScopedJavaLocalRef<jobject> tmp(env, env->NewObject(cls.obj(), constructor,
GetApplicationContext()));
DCHECK(tmp.obj());
java_scroller_.Reset(tmp);
- fling_method_id_ = GetMethodID(env, cls, "fling", "(IIIIIIII)V");
- abort_method_id_ = GetMethodID(env, cls, "abortAnimation", "()V");
- compute_method_id_ = GetMethodID(env, cls, "computeScrollOffset", "()Z");
- getX_method_id_ = GetMethodID(env, cls, "getCurrX", "()I");
- getY_method_id_ = GetMethodID(env, cls, "getCurrY", "()I");
+ fling_method_id_ = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "fling", "(IIIIIIII)V");
+ abort_method_id_ = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "abortAnimation", "()V");
+ compute_method_id_ = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "computeScrollOffset", "()Z");
+ getX_method_id_ = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "getCurrX", "()I");
+ getY_method_id_ = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_YES>(
+ env, cls.obj(), "getCurrY", "()I");
}
FlingAnimatorImpl::~FlingAnimatorImpl()
« ui/base/clipboard/clipboard_unittest.cc ('K') | « ui/base/clipboard/clipboard_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698