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

Unified Diff: content/browser/android/download_controller.cc

Issue 11038015: Android: lazy initialization for method id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removes EXCEPTIONCHECK. 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: content/browser/android/download_controller.cc
diff --git a/content/browser/android/download_controller.cc b/content/browser/android/download_controller.cc
index d16784759361f421fca9a88ff40559042655ff2e..b590632d8fe56c3cf72a64bad96cc060de942794 100644
--- a/content/browser/android/download_controller.cc
+++ b/content/browser/android/download_controller.cc
@@ -29,6 +29,7 @@ using base::android::AttachCurrentThread;
using base::android::CheckException;
using base::android::ConvertUTF8ToJavaString;
using base::android::GetClass;
+using base::android::MethodID;
using base::android::ScopedJavaLocalRef;
namespace {
@@ -301,7 +302,8 @@ DownloadController::JavaObject* DownloadController::GetJavaObject() {
JNIEnv* env = AttachCurrentThread();
ScopedJavaLocalRef<jclass> clazz =
GetClass(env, kDownloadControllerClassPathName);
- jmethodID get_instance = GetStaticMethodID(env, clazz, "getInstance",
+ jmethodID get_instance = MethodID::Get<MethodID::METHODTYPE_NORMAL>(
+ env, clazz.obj(), "getInstance",
"()Lorg/chromium/content/browser/DownloadController;");
ScopedJavaLocalRef<jobject> jobj(env,
env->CallStaticObjectMethod(clazz.obj(), get_instance));

Powered by Google App Engine
This is Rietveld 408576698