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

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

Issue 10996063: Android: adds Get(Static)MethodIDOrNULL. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comments Created 8 years, 3 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..174c9204349b71ec6ae79e861a488c1463417775 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::GetMethodIDOrNULL;
Sami 2012/10/01 15:46:00 Looks like NULL is still upper case here.
bulach 2012/10/01 17:25:00 Done.
using base::android::ScopedJavaLocalRef;
using content::BrowserThread;
@@ -62,12 +61,13 @@ ScopedJavaLocalRef<jobject> SQLiteCursor::NewJavaSqliteCursor(
}
ScopedJavaLocalRef<jclass> sclass = GetClass(env, kSQLiteCursorClassPath);
- if (!HasMethod(env, sclass, "<init>", "(I)V")) {
+
+ jmethodID method_id = GetMethodIDOrNULL(env, sclass, "<init>", "(I)V");
+ if (!method_id) {
joth 2012/10/01 16:15:27 can we comment why it's OK for this not to exist (
bulach 2012/10/01 17:25:00 ugh, good point.. I think it's one of those "just
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,
« base/android/jni_android.cc ('K') | « base/android/jni_generator/jni_generator_tests.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698