-// 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.
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
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",
"("
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",
"("
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",
"("
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",
"("
&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;
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",
"("
&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);
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("
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",
"("