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/Test | 8 // org/chromium/example/jni_generator/Test |
9 | 9 |
10 #ifndef org_chromium_example_jni_generator_Test_JNI | 10 #ifndef org_chromium_example_jni_generator_Test_JNI |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 static const JNINativeMethod kMethodsTest[] = { | 72 static const JNINativeMethod kMethodsTest[] = { |
73 { "nativeMethod", | 73 { "nativeMethod", |
74 "(" | 74 "(" |
75 "J" | 75 "J" |
76 "I" | 76 "I" |
77 ")" | 77 ")" |
78 "I", reinterpret_cast<void*>(Method) }, | 78 "I", reinterpret_cast<void*>(Method) }, |
79 }; | 79 }; |
80 | 80 |
81 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) { | 81 static bool RegisterNativesImpl(JNIEnv* env, jclass clazz) { |
| 82 |
82 g_Test_clazz = static_cast<jclass>(env->NewWeakGlobalRef(clazz)); | 83 g_Test_clazz = static_cast<jclass>(env->NewWeakGlobalRef(clazz)); |
83 | 84 |
84 const int kMethodsTestSize = arraysize(kMethodsTest); | 85 const int kMethodsTestSize = arraysize(kMethodsTest); |
85 | 86 |
86 if (env->RegisterNatives(Test_clazz(env), | 87 if (env->RegisterNatives(Test_clazz(env), |
87 kMethodsTest, | 88 kMethodsTest, |
88 kMethodsTestSize) < 0) { | 89 kMethodsTestSize) < 0) { |
89 jni_generator::HandleRegistrationError( | 90 jni_generator::HandleRegistrationError( |
90 env, Test_clazz(env), __FILE__); | 91 env, Test_clazz(env), __FILE__); |
91 return false; | 92 return false; |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 return true; | 137 return true; |
137 } | 138 } |
138 | 139 |
139 extern "C" JNIEXPORT bool JNICALL | 140 extern "C" JNIEXPORT bool JNICALL |
140 Java_org_chromium_example_jni_generator_Test_nativeInitNativeClass(JNIEnv* env, | 141 Java_org_chromium_example_jni_generator_Test_nativeInitNativeClass(JNIEnv* env, |
141 jclass clazz) { | 142 jclass clazz) { |
142 return RegisterNativesImpl(env, clazz); | 143 return RegisterNativesImpl(env, clazz); |
143 } | 144 } |
144 | 145 |
145 #endif // org_chromium_example_jni_generator_Test_JNI | 146 #endif // org_chromium_example_jni_generator_Test_JNI |
OLD | NEW |