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

Unified Diff: trunk/src/base/android/jni_generator/golden_sample_for_tests_jni.h

Issue 492713002: Revert 290810 "Make class lookup lazy in jni_generator when usin..." (Closed) Base URL: svn://svn.chromium.org/chrome/
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
« no previous file with comments | « trunk/src/base/android/jni_android.cc ('k') | trunk/src/base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/src/base/android/jni_generator/golden_sample_for_tests_jni.h
===================================================================
--- trunk/src/base/android/jni_generator/golden_sample_for_tests_jni.h (revision 290812)
+++ trunk/src/base/android/jni_generator/golden_sample_for_tests_jni.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright 2014 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 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.
@@ -24,22 +24,12 @@
"org/chromium/example/jni_generator/SampleForTests";
const char kInnerStructBClassPath[] =
"org/chromium/example/jni_generator/SampleForTests$InnerStructB";
-#if __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wunused-function"
-#endif
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_InnerStructA_clazz = NULL;
-jclass InnerStructA_clazz(JNIEnv*) { return g_InnerStructA_clazz; }
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_SampleForTests_clazz = NULL;
-jclass SampleForTests_clazz(JNIEnv*) { return g_SampleForTests_clazz; }
// Leaking this jclass as we cannot use LazyInstance from some threads.
jclass g_InnerStructB_clazz = NULL;
-jclass InnerStructB_clazz(JNIEnv*) { return g_InnerStructB_clazz; }
-#if __clang__
-#pragma clang diagnostic pop
-#endif
} // namespace
@@ -109,11 +99,11 @@
JniIntWrapper bar) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env), 0);
+ g_SampleForTests_clazz, 0);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"javaMethod",
"("
@@ -133,12 +123,12 @@
static base::subtle::AtomicWord g_SampleForTests_staticJavaMethod = 0;
static jboolean Java_SampleForTests_staticJavaMethod(JNIEnv* env) {
/* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, SampleForTests_clazz(env),
- SampleForTests_clazz(env), false);
+ CHECK_CLAZZ(env, g_SampleForTests_clazz,
+ g_SampleForTests_clazz, false);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_STATIC>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"staticJavaMethod",
"("
@@ -147,7 +137,7 @@
&g_SampleForTests_staticJavaMethod);
jboolean ret =
- env->CallStaticBooleanMethod(SampleForTests_clazz(env),
+ env->CallStaticBooleanMethod(g_SampleForTests_clazz,
method_id);
jni_generator::CheckException(env);
return ret;
@@ -158,11 +148,11 @@
obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env));
+ g_SampleForTests_clazz);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"packagePrivateJavaMethod",
"("
@@ -181,11 +171,11 @@
obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env));
+ g_SampleForTests_clazz);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"methodThatThrowsException",
"("
@@ -204,12 +194,12 @@
JniIntWrapper i,
jstring s) {
/* Must call RegisterNativesImpl() */
- CHECK_CLAZZ(env, InnerStructA_clazz(env),
- InnerStructA_clazz(env), NULL);
+ CHECK_CLAZZ(env, g_InnerStructA_clazz,
+ g_InnerStructA_clazz, NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_STATIC>(
- env, InnerStructA_clazz(env),
+ env, g_InnerStructA_clazz,
"create",
"("
@@ -221,7 +211,7 @@
&g_InnerStructA_create);
jobject ret =
- env->CallStaticObjectMethod(InnerStructA_clazz(env),
+ env->CallStaticObjectMethod(g_InnerStructA_clazz,
method_id, l, as_jint(i), s);
jni_generator::CheckException(env);
return base::android::ScopedJavaLocalRef<jobject>(env, ret);
@@ -232,11 +222,11 @@
{
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env));
+ g_SampleForTests_clazz);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"addStructA",
"("
@@ -256,11 +246,11 @@
{
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- SampleForTests_clazz(env));
+ g_SampleForTests_clazz);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, SampleForTests_clazz(env),
+ env, g_SampleForTests_clazz,
"iterateAndDoSomething",
"("
@@ -278,11 +268,11 @@
static jlong Java_InnerStructB_getKey(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- InnerStructB_clazz(env), 0);
+ g_InnerStructB_clazz, 0);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, InnerStructB_clazz(env),
+ env, g_InnerStructB_clazz,
"getKey",
"("
@@ -302,11 +292,11 @@
Java_InnerStructB_getValue(JNIEnv* env, jobject obj) {
/* Must call RegisterNativesImpl() */
CHECK_CLAZZ(env, obj,
- InnerStructB_clazz(env), NULL);
+ g_InnerStructB_clazz, NULL);
jmethodID method_id =
base::android::MethodID::LazyGet<
base::android::MethodID::TYPE_INSTANCE>(
- env, InnerStructB_clazz(env),
+ env, g_InnerStructB_clazz,
"getValue",
"("
@@ -389,11 +379,11 @@
const int kMethodsSampleForTestsSize = arraysize(kMethodsSampleForTests);
- if (env->RegisterNatives(SampleForTests_clazz(env),
+ if (env->RegisterNatives(g_SampleForTests_clazz,
kMethodsSampleForTests,
kMethodsSampleForTestsSize) < 0) {
jni_generator::HandleRegistrationError(
- env, SampleForTests_clazz(env), __FILE__);
+ env, g_SampleForTests_clazz, __FILE__);
return false;
}
« no previous file with comments | « trunk/src/base/android/jni_android.cc ('k') | trunk/src/base/android/jni_generator/jni_generator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698