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

Unified Diff: base/android/jni_generator/testEagerCalledByNativesOption.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/testEagerCalledByNativesOption.golden
diff --git a/base/android/jni_generator/testEagerCalledByNativesOption.golden b/base/android/jni_generator/testEagerCalledByNativesOption.golden
index 4ff81ac516434eb81e5bc57d8daf48d9f76e843c..6c1323ed99c0c15960e24d290766d542ed4e09f2 100644
--- a/base/android/jni_generator/testEagerCalledByNativesOption.golden
+++ b/base/android/jni_generator/testEagerCalledByNativesOption.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.
@@ -21,6 +21,7 @@ namespace {
const char kTestClassPath[] = "org/chromium/example/jni_generator/Test";
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_Test_clazz = NULL;
+#define Test_clazz(env) g_Test_clazz
jmethodID g_Test_testMethodWithParam = NULL;
jmethodID g_Test_testStaticMethodWithParam = NULL;
jmethodID g_Test_testMethodWithNoParam = NULL;
@@ -46,20 +47,21 @@ static void testMethodWithParam(JNIEnv* env, jobject obj, JniIntWrapper iParam)
}
static jint testStaticMethodWithParam(JNIEnv* env, JniIntWrapper iParam) {
- jint ret = env->CallStaticIntMethod(g_Test_clazz,
+ jint ret = env->CallStaticIntMethod(Test_clazz(env),
g_Test_testStaticMethodWithParam, as_jint(iParam));
return ret;
}
static jdouble testMethodWithNoParam(JNIEnv* env) {
- jdouble ret = env->CallStaticDoubleMethod(g_Test_clazz,
+ jdouble ret = env->CallStaticDoubleMethod(Test_clazz(env),
g_Test_testMethodWithNoParam);
return ret;
}
static base::android::ScopedJavaLocalRef<jstring>
testStaticMethodWithNoParam(JNIEnv* env) {
- jstring ret = static_cast<jstring>(env->CallStaticObjectMethod(g_Test_clazz,
+ jstring ret =
+ static_cast<jstring>(env->CallStaticObjectMethod(Test_clazz(env),
g_Test_testStaticMethodWithNoParam));
return base::android::ScopedJavaLocalRef<jstring>(env, ret);
}
@@ -81,16 +83,16 @@ static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
const int kMethodsTestSize = arraysize(kMethodsTest);
- if (env->RegisterNatives(g_Test_clazz,
+ if (env->RegisterNatives(Test_clazz(env),
kMethodsTest,
kMethodsTestSize) < 0) {
jni_generator::HandleRegistrationError(
- env, g_Test_clazz, __FILE__);
+ env, Test_clazz(env), __FILE__);
return false;
}
g_Test_testMethodWithParam = env->GetMethodID(
- g_Test_clazz,
+ Test_clazz(env),
"testMethodWithParam",
"("
"I"
@@ -101,7 +103,7 @@ static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
}
g_Test_testStaticMethodWithParam = env->GetStaticMethodID(
- g_Test_clazz,
+ Test_clazz(env),
"testStaticMethodWithParam",
"("
"I"
@@ -112,7 +114,7 @@ static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
}
g_Test_testMethodWithNoParam = env->GetStaticMethodID(
- g_Test_clazz,
+ Test_clazz(env),
"testMethodWithNoParam",
"("
")"
@@ -122,7 +124,7 @@ static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) {
}
g_Test_testStaticMethodWithNoParam = env->GetStaticMethodID(
- g_Test_clazz,
+ Test_clazz(env),
"testStaticMethodWithNoParam",
"("
")"
« no previous file with comments | « base/android/jni_generator/testConstantsFromJavaP.golden ('k') | base/android/jni_generator/testFromJavaP.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698