| 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 12 matching lines...) Expand all Loading... |
| 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 extern "C" { | 29 extern "C" { |
| 30 | 30 |
| 31 static jint Init(JNIEnv* env, jobject jcaller); | 31 static jint Init(JNIEnv* env, jobject jcaller); |
| 32 | 32 |
| 33 __attribute__((visibility("default"), alias("Init"))) | 33 __attribute__((visibility("default"))) |
| 34 jint | 34 jint |
| 35 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na
tiveInit(JNIEnv* | 35 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyInnerClass_na
tiveInit(JNIEnv* |
| 36 env, jobject jcaller); | 36 env, jobject jcaller) { |
| 37 return Init(env, jcaller); |
| 38 } |
| 37 | 39 |
| 38 static jint Init(JNIEnv* env, jobject jcaller); | 40 static jint Init(JNIEnv* env, jobject jcaller); |
| 39 | 41 |
| 40 __attribute__((visibility("default"), alias("Init"))) | 42 __attribute__((visibility("default"))) |
| 41 jint | 43 jint |
| 42 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla
ss_nativeInit(JNIEnv* | 44 Java_org_chromium_example_jni_1generator_SampleForTests_00024MyOtherInnerCla
ss_nativeInit(JNIEnv* |
| 43 env, jobject jcaller); | 45 env, jobject jcaller) { |
| 46 return Init(env, jcaller); |
| 47 } |
| 44 | 48 |
| 45 }; // extern "C" | 49 }; // extern "C" |
| 46 | 50 |
| 47 // Step 2: method stubs. | 51 // Step 2: method stubs. |
| 48 | 52 |
| 49 extern "C" { | 53 extern "C" { |
| 50 __attribute__((visibility("default"))) | 54 __attribute__((visibility("default"))) |
| 51 jint | 55 jint |
| 52 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J
NIEnv* | 56 Java_org_chromium_example_jni_1generator_SampleForTests_nativeStaticMethod(J
NIEnv* |
| 53 env, | 57 env, |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 "J" | 234 "J" |
| 231 "I" | 235 "I" |
| 232 ")" | 236 ")" |
| 233 "I", | 237 "I", |
| 234 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe
sts_nativeMethod) | 238 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe
sts_nativeMethod) |
| 235 }, | 239 }, |
| 236 }; | 240 }; |
| 237 | 241 |
| 238 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) { | 242 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) { |
| 239 if (base::android::IsManualJniRegistrationDisabled()) return true; | 243 if (base::android::IsManualJniRegistrationDisabled()) return true; |
| 240 base::subtle::Release_Store(&g_SampleForTests_clazz, | 244 |
| 245 base::subtle::Release_Store(&g_SampleForTests_clazz, |
| 241 static_cast<base::subtle::AtomicWord>(env->NewWeakGlobalRef(clazz)); | 246 static_cast<base::subtle::AtomicWord>(env->NewWeakGlobalRef(clazz)); |
| 242 | 247 |
| 243 const int kMethodsMyOtherInnerClassSize = | 248 const int kMethodsMyOtherInnerClassSize = |
| 244 arraysize(kMethodsMyOtherInnerClass); | 249 arraysize(kMethodsMyOtherInnerClass); |
| 245 | 250 |
| 246 if (env->RegisterNatives(MyOtherInnerClass_clazz(env), | 251 if (env->RegisterNatives(MyOtherInnerClass_clazz(env), |
| 247 kMethodsMyOtherInnerClass, | 252 kMethodsMyOtherInnerClass, |
| 248 kMethodsMyOtherInnerClassSize) < 0) { | 253 kMethodsMyOtherInnerClassSize) < 0) { |
| 249 jni_generator::HandleRegistrationError( | 254 jni_generator::HandleRegistrationError( |
| 250 env, MyOtherInnerClass_clazz(env), __FILE__); | 255 env, MyOtherInnerClass_clazz(env), __FILE__); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 274 return true; | 279 return true; |
| 275 } | 280 } |
| 276 | 281 |
| 277 extern "C" JNIEXPORT bool JNICALL | 282 extern "C" JNIEXPORT bool JNICALL |
| 278 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN
IEnv* | 283 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN
IEnv* |
| 279 env, jclass clazz) { | 284 env, jclass clazz) { |
| 280 return RegisterNativesImpl(env, clazz); | 285 return RegisterNativesImpl(env, clazz); |
| 281 } | 286 } |
| 282 | 287 |
| 283 #endif // org_chromium_example_jni_generator_SampleForTests_JNI | 288 #endif // org_chromium_example_jni_generator_SampleForTests_JNI |
| OLD | NEW |