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

Unified Diff: base/android/jni_generator/testCalledByNatives.golden

Issue 491043002: Make class lookup lazy in jni_generator when using lazy method lookup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 4 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: base/android/jni_generator/testCalledByNatives.golden
diff --git a/base/android/jni_generator/testCalledByNatives.golden b/base/android/jni_generator/testCalledByNatives.golden
index abdc50740b5d3f51969435e9944f2e7b356aa61a..22aa45d39a1b86cc3f76dd681bbc6574fdc61f13 100644
--- a/base/android/jni_generator/testCalledByNatives.golden
+++ b/base/android/jni_generator/testCalledByNatives.golden
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -22,8 +22,10 @@ const char kTestJniClassPath[] = "org/chromium/TestJni";
const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar";
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_TestJni_clazz = NULL;
+#define TestJni_clazz(env) g_TestJni_clazz
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_InfoBar_clazz = NULL;
+#define InfoBar_clazz(env) g_InfoBar_clazz
} // namespace
@@ -39,11 +41,11 @@ static base::android::ScopedJavaLocalRef<jobject>
jobject icon) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"showConfirmInfoBar",
"("
@@ -73,11 +75,11 @@ static base::android::ScopedJavaLocalRef<jobject>
jstring args) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"showAutoLoginInfoBar",
"("
@@ -100,11 +102,11 @@ static base::subtle::AtomicWord g_InfoBar_dismiss = 0;
static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_InfoBar_clazz);
+ InfoBar_clazz(env));
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_InfoBar_clazz,
+ env, InfoBar_clazz(env),
"dismiss",
"("
@@ -124,12 +126,12 @@ static jboolean Java_TestJni_shouldShowAutoLogin(JNIEnv* env, jobject view,
jstring account,
jstring args) {
/* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, g_TestJni_clazz,
- g_TestJni_clazz, false);
+ CHECK_CLAZZ(env, TestJni_clazz(env),
+ TestJni_clazz(env), false);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_STATIC>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"shouldShowAutoLogin",
"("
@@ -142,7 +144,7 @@ static jboolean Java_TestJni_shouldShowAutoLogin(JNIEnv* env, jobject view,
&g_TestJni_shouldShowAutoLogin);
jboolean ret =
- env->CallStaticBooleanMethod(g_TestJni_clazz,
+ env->CallStaticBooleanMethod(TestJni_clazz(env),
method_id, view, realm, account, args);
jni_generator::CheckException(env);
return ret;
@@ -152,12 +154,12 @@ static base::subtle::AtomicWord g_TestJni_openUrl = 0;
static base::android::ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv*
env, jstring url) {
/* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, g_TestJni_clazz,
- g_TestJni_clazz, NULL);
+ CHECK_CLAZZ(env, TestJni_clazz(env),
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_STATIC>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"openUrl",
"("
@@ -167,7 +169,7 @@ static base::android::ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv*
&g_TestJni_openUrl);
jobject ret =
- env->CallStaticObjectMethod(g_TestJni_clazz,
+ env->CallStaticObjectMethod(TestJni_clazz(env),
method_id, url);
jni_generator::CheckException(env);
return base::android::ScopedJavaLocalRef<jobject>(env, ret);
@@ -182,11 +184,11 @@ static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj,
JniIntWrapper iSecondaryID) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz);
+ TestJni_clazz(env));
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"activateHardwareAcceleration",
"("
@@ -211,11 +213,11 @@ static void Java_TestJni_uncheckedCall(JNIEnv* env, jobject obj, JniIntWrapper
iParam) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz);
+ TestJni_clazz(env));
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"uncheckedCall",
"("
@@ -234,11 +236,11 @@ static base::android::ScopedJavaLocalRef<jbyteArray>
Java_TestJni_returnByteArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnByteArray",
"("
@@ -258,11 +260,11 @@ static base::android::ScopedJavaLocalRef<jbooleanArray>
Java_TestJni_returnBooleanArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnBooleanArray",
"("
@@ -282,11 +284,11 @@ static base::android::ScopedJavaLocalRef<jcharArray>
Java_TestJni_returnCharArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnCharArray",
"("
@@ -306,11 +308,11 @@ static base::android::ScopedJavaLocalRef<jshortArray>
Java_TestJni_returnShortArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnShortArray",
"("
@@ -330,11 +332,11 @@ static base::android::ScopedJavaLocalRef<jintArray>
Java_TestJni_returnIntArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnIntArray",
"("
@@ -354,11 +356,11 @@ static base::android::ScopedJavaLocalRef<jlongArray>
Java_TestJni_returnLongArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnLongArray",
"("
@@ -378,11 +380,11 @@ static base::android::ScopedJavaLocalRef<jdoubleArray>
Java_TestJni_returnDoubleArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnDoubleArray",
"("
@@ -402,11 +404,11 @@ static base::android::ScopedJavaLocalRef<jobjectArray>
Java_TestJni_returnObjectArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnObjectArray",
"("
@@ -426,11 +428,11 @@ static base::android::ScopedJavaLocalRef<jobjectArray>
Java_TestJni_returnArrayOfByteArray(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"returnArrayOfByteArray",
"("
@@ -450,11 +452,11 @@ static base::android::ScopedJavaLocalRef<jobject>
Java_TestJni_getCompressFormat(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"getCompressFormat",
"("
@@ -474,11 +476,11 @@ static base::android::ScopedJavaLocalRef<jobject>
Java_TestJni_getCompressFormatList(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- g_TestJni_clazz, NULL);
+ TestJni_clazz(env), NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, g_TestJni_clazz,
+ env, TestJni_clazz(env),
"getCompressFormatList",
"("
« no previous file with comments | « base/android/jni_generator/jni_generator.py ('k') | base/android/jni_generator/testConstantsFromJavaP.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698