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

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: 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: 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..51ee4b1c02a517f4955290cdb073e8f630ae3788 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,14 @@ ScopedJavaLocalRef<jobject> SQLiteCursor::NewJavaSqliteCursor(
}
ScopedJavaLocalRef<jclass> sclass = GetClass(env, kSQLiteCursorClassPath);
- if (!HasMethod(env, sclass, "<init>", "(I)V")) {
+ jmethodID method_id = MethodID::Get<
+ MethodID::METHODTYPE_NORMAL, MethodID::EXCEPTIONCHECK_NO>(
joth 2012/10/04 17:59:59 For the non-lazy API I'm ambivalent about switchin
bulach 2012/10/04 18:58:17 well, a few steps back :) aren't your eyes ignorin
nyquist 2012/10/04 19:05:48 So, I kind of agree with joth that it might be har
+ env, sclass.obj(), "<init>", "(I)V");
+ if (!method_id) {
LOG(ERROR) << "Can not find " << kSQLiteCursorClassPath << " Constructor";
return ScopedJavaLocalRef<jobject>();
}
- jmethodID method_id = GetMethodID(env, sclass, "<init>", "(I)V");
SQLiteCursor* cursor = new SQLiteCursor(column_names, statement, service,
favicon_service);
ScopedJavaLocalRef<jobject> obj(env,

Powered by Google App Engine
This is Rietveld 408576698