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

Unified Diff: chrome/browser/history/android/sqlite_cursor.cc

Issue 11038015: Android: lazy initialization for method id. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased 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: chrome/browser/history/android/sqlite_cursor.cc
diff --git a/chrome/browser/history/android/sqlite_cursor.cc b/chrome/browser/history/android/sqlite_cursor.cc
index 786e157c7e090978b5666162fbdaaa71adb2b1d2..883b0999b61bd3349af3797255d58aee8b550138 100644
--- a/chrome/browser/history/android/sqlite_cursor.cc
+++ b/chrome/browser/history/android/sqlite_cursor.cc
@@ -16,8 +16,7 @@
using base::android::ConvertUTF8ToJavaString;
using base::android::GetClass;
using base::android::HasClass;
-using base::android::HasMethod;
-using base::android::GetMethodID;
+using base::android::MethodID;
using base::android::ScopedJavaLocalRef;
using content::BrowserThread;
@@ -62,12 +61,9 @@ ScopedJavaLocalRef<jobject> SQLiteCursor::NewJavaSqliteCursor(
}
ScopedJavaLocalRef<jclass> sclass = GetClass(env, kSQLiteCursorClassPath);
- if (!HasMethod(env, sclass, "<init>", "(I)V")) {
- LOG(ERROR) << "Can not find " << kSQLiteCursorClassPath << " Constructor";
- return ScopedJavaLocalRef<jobject>();
- }
+ jmethodID method_id = MethodID::Get<MethodID::TYPE_INSTANCE>(
+ env, sclass.obj(), "<init>", "(I)V");
- jmethodID method_id = GetMethodID(env, sclass, "<init>", "(I)V");
SQLiteCursor* cursor = new SQLiteCursor(column_names, statement, service,
favicon_service);
ScopedJavaLocalRef<jobject> obj(env,
« no previous file with comments | « chrome/browser/android/provider/chrome_browser_provider.cc ('k') | content/browser/android/content_view_core_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698