| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // This file is autogenerated by | 5 // This file is autogenerated by |
| 6 // base/android/jni_generator/jni_generator.py | 6 // base/android/jni_generator/jni_generator.py |
| 7 // For | 7 // For |
| 8 // org/chromium/example/jni_generator/SampleForTests | 8 // org/chromium/example/jni_generator/SampleForTests |
| 9 | 9 |
| 10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI | 10 #ifndef org_chromium_example_jni_generator_SampleForTests_JNI |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 const char kSampleForTestsClassPath[] = | 21 const char kSampleForTestsClassPath[] = |
| 22 "org/chromium/example/jni_generator/SampleForTests"; | 22 "org/chromium/example/jni_generator/SampleForTests"; |
| 23 // Leaking this jclass as we cannot use LazyInstance from some threads. | 23 // Leaking this jclass as we cannot use LazyInstance from some threads. |
| 24 base::subtle::AtomicWord g_SampleForTests_clazz __attribute__((unused)) = 0; | 24 base::subtle::AtomicWord g_SampleForTests_clazz __attribute__((unused)) = 0; |
| 25 #define SampleForTests_clazz(env) base::android::LazyGetClass(env, kSampleForTes
tsClassPath, &g_SampleForTests_clazz) | 25 #define SampleForTests_clazz(env) base::android::LazyGetClass(env, kSampleForTes
tsClassPath, &g_SampleForTests_clazz) |
| 26 | 26 |
| 27 } // namespace | 27 } // namespace |
| 28 | 28 |
| 29 // Step 2: method stubs. | 29 // Step 2: method stubs. |
| 30 extern "C" __attribute__((visibility("default"))) | 30 extern "C" __attribute__((visibility("default"))) |
| 31 #if defined(ARCH_CPU_X86) |
| 32 __attribute__((force_align_arg_pointer)) |
| 33 #endif |
| 31 jint | 34 jint |
| 32 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J
NIEnv* | 35 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J
NIEnv* |
| 33 env, | 36 env, |
| 34 jobject jcaller, | 37 jobject jcaller, |
| 35 jlong nativeTest, | 38 jlong nativeTest, |
| 36 jint arg1) { | 39 jint arg1) { |
| 37 Test* native = reinterpret_cast<Test*>(nativeTest); | 40 Test* native = reinterpret_cast<Test*>(nativeTest); |
| 38 CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0); | 41 CHECK_NATIVE_PTR(env, jcaller, native, "StaticMethod", 0); |
| 39 return native->StaticMethod(env, base::android::JavaParamRef<jobject>(env, | 42 return native->StaticMethod(env, base::android::JavaParamRef<jobject>(env, |
| 40 jcaller), arg1); | 43 jcaller), arg1); |
| 41 } | 44 } |
| 42 | 45 |
| 43 extern "C" __attribute__((visibility("default"))) | 46 extern "C" __attribute__((visibility("default"))) |
| 47 #if defined(ARCH_CPU_X86) |
| 48 __attribute__((force_align_arg_pointer)) |
| 49 #endif |
| 44 jint | 50 jint |
| 45 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv* | 51 Java_org_chromium_example_jni_1generator_SampleForTests_nativeMethod(JNIEnv* |
| 46 env, | 52 env, |
| 47 jobject jcaller, | 53 jobject jcaller, |
| 48 jlong nativeTest, | 54 jlong nativeTest, |
| 49 jint arg1) { | 55 jint arg1) { |
| 50 Test* native = reinterpret_cast<Test*>(nativeTest); | 56 Test* native = reinterpret_cast<Test*>(nativeTest); |
| 51 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0); | 57 CHECK_NATIVE_PTR(env, jcaller, native, "Method", 0); |
| 52 return native->Method(env, base::android::JavaParamRef<jobject>(env, jcaller), | 58 return native->Method(env, base::android::JavaParamRef<jobject>(env, jcaller), |
| 53 arg1); | 59 arg1); |
| 54 } | 60 } |
| 55 | 61 |
| 56 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& | 62 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& |
| 57 jcaller); | 63 jcaller); |
| 58 | 64 |
| 59 extern "C" __attribute__((visibility("default"))) | 65 extern "C" __attribute__((visibility("default"))) |
| 66 #if defined(ARCH_CPU_X86) |
| 67 __attribute__((force_align_arg_pointer)) |
| 68 #endif |
| 60 jint | 69 jint |
| 61 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na
tiveInit(JNIEnv* | 70 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na
tiveInit(JNIEnv* |
| 62 env, jobject jcaller) { | 71 env, jobject jcaller) { |
| 63 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); | 72 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); |
| 64 } | 73 } |
| 65 | 74 |
| 66 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& | 75 static jint Init(JNIEnv* env, const base::android::JavaParamRef<jobject>& |
| 67 jcaller); | 76 jcaller); |
| 68 | 77 |
| 69 extern "C" __attribute__((visibility("default"))) | 78 extern "C" __attribute__((visibility("default"))) |
| 79 #if defined(ARCH_CPU_X86) |
| 80 __attribute__((force_align_arg_pointer)) |
| 81 #endif |
| 70 jint | 82 jint |
| 71 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla
ss_nativeInit(JNIEnv* | 83 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla
ss_nativeInit(JNIEnv* |
| 72 env, jobject jcaller) { | 84 env, jobject jcaller) { |
| 73 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); | 85 return Init(env, base::android::JavaParamRef<jobject>(env, jcaller)); |
| 74 } | 86 } |
| 75 | 87 |
| 76 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; | 88 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParam = 0; |
| 77 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, const | 89 static void Java_SampleForTests_testMethodWithParam(JNIEnv* env, const |
| 78 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { | 90 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper iParam) { |
| 79 CHECK_CLAZZ(env, obj.obj(), | 91 CHECK_CLAZZ(env, obj.obj(), |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 jstring ret = | 194 jstring ret = |
| 183 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), | 195 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), |
| 184 method_id)); | 196 method_id)); |
| 185 jni_generator::CheckException(env); | 197 jni_generator::CheckException(env); |
| 186 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 198 return base::android::ScopedJavaLocalRef<jstring>(env, ret); |
| 187 } | 199 } |
| 188 | 200 |
| 189 // Step 3: RegisterNatives. | 201 // Step 3: RegisterNatives. |
| 190 | 202 |
| 191 #endif // org_chromium_example_jni_generator_SampleForTests_JNI | 203 #endif // org_chromium_example_jni_generator_SampleForTests_JNI |
| OLD | NEW |