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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
88 &g_SampleForTests_testMethodWithParam); | 88 &g_SampleForTests_testMethodWithParam); |
89 | 89 |
90 env->CallVoidMethod(obj, | 90 env->CallVoidMethod(obj, |
91 method_id, as_jint(iParam)); | 91 method_id, as_jint(iParam)); |
92 jni_generator::CheckException(env); | 92 jni_generator::CheckException(env); |
93 | 93 |
94 } | 94 } |
95 | 95 |
96 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = | 96 static base::subtle::AtomicWord g_SampleForTests_testMethodWithParamAndReturn = |
97 0; | 97 0; |
98 static base::android::ScopedJavaLocalRef<jstring> | 98 static ScopedJavaLocalRef<jstring> |
99 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj, | 99 Java_SampleForTests_testMethodWithParamAndReturn(JNIEnv* env, jobject obj, |
100 JniIntWrapper iParam) { | 100 JniIntWrapper iParam) { |
101 /* Must call RegisterNativesImpl() */ | 101 /* Must call RegisterNativesImpl() */ |
102 CHECK_CLAZZ(env, obj, | 102 CHECK_CLAZZ(env, obj, |
103 SampleForTests_clazz(env), NULL); | 103 SampleForTests_clazz(env), NULL); |
104 jmethodID method_id = | 104 jmethodID method_id = |
105 base::android::MethodID::LazyGet< | 105 base::android::MethodID::LazyGet< |
106 base::android::MethodID::TYPE_INSTANCE>( | 106 base::android::MethodID::TYPE_INSTANCE>( |
107 env, SampleForTests_clazz(env), | 107 env, SampleForTests_clazz(env), |
108 "testMethodWithParamAndReturn", | 108 "testMethodWithParamAndReturn", |
109 | 109 |
110 "(" | 110 "(" |
111 "I" | 111 "I" |
112 ")" | 112 ")" |
113 "Ljava/lang/String;", | 113 "Ljava/lang/String;", |
114 &g_SampleForTests_testMethodWithParamAndReturn); | 114 &g_SampleForTests_testMethodWithParamAndReturn); |
115 | 115 |
116 jstring ret = | 116 jstring ret = |
117 static_cast<jstring>(env->CallObjectMethod(obj, | 117 static_cast<jstring>(env->CallObjectMethod(obj, |
118 method_id, as_jint(iParam))); | 118 method_id, as_jint(iParam))); |
119 jni_generator::CheckException(env); | 119 jni_generator::CheckException(env); |
120 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 120 return ScopedJavaLocalRef<jstring>(env, ret); |
121 } | 121 } |
122 | 122 |
123 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; | 123 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithParam = 0; |
124 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, | 124 static jint Java_SampleForTests_testStaticMethodWithParam(JNIEnv* env, |
125 JniIntWrapper iParam) { | 125 JniIntWrapper iParam) { |
126 /* Must call RegisterNativesImpl() */ | 126 /* Must call RegisterNativesImpl() */ |
127 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 127 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
128 SampleForTests_clazz(env), 0); | 128 SampleForTests_clazz(env), 0); |
129 jmethodID method_id = | 129 jmethodID method_id = |
130 base::android::MethodID::LazyGet< | 130 base::android::MethodID::LazyGet< |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 | 163 |
164 jdouble ret = | 164 jdouble ret = |
165 env->CallStaticDoubleMethod(SampleForTests_clazz(env), | 165 env->CallStaticDoubleMethod(SampleForTests_clazz(env), |
166 method_id); | 166 method_id); |
167 jni_generator::CheckException(env); | 167 jni_generator::CheckException(env); |
168 return ret; | 168 return ret; |
169 } | 169 } |
170 | 170 |
171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = | 171 static base::subtle::AtomicWord g_SampleForTests_testStaticMethodWithNoParam = |
172 0; | 172 0; |
173 static base::android::ScopedJavaLocalRef<jstring> | 173 static ScopedJavaLocalRef<jstring> |
174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { | 174 Java_SampleForTests_testStaticMethodWithNoParam(JNIEnv* env) { |
175 /* Must call RegisterNativesImpl() */ | 175 /* Must call RegisterNativesImpl() */ |
176 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 176 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
177 SampleForTests_clazz(env), NULL); | 177 SampleForTests_clazz(env), NULL); |
178 jmethodID method_id = | 178 jmethodID method_id = |
179 base::android::MethodID::LazyGet< | 179 base::android::MethodID::LazyGet< |
180 base::android::MethodID::TYPE_STATIC>( | 180 base::android::MethodID::TYPE_STATIC>( |
181 env, SampleForTests_clazz(env), | 181 env, SampleForTests_clazz(env), |
182 "testStaticMethodWithNoParam", | 182 "testStaticMethodWithNoParam", |
183 | 183 |
184 "(" | 184 "(" |
185 ")" | 185 ")" |
186 "Ljava/lang/String;", | 186 "Ljava/lang/String;", |
187 &g_SampleForTests_testStaticMethodWithNoParam); | 187 &g_SampleForTests_testStaticMethodWithNoParam); |
188 | 188 |
189 jstring ret = | 189 jstring ret = |
190 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), | 190 static_cast<jstring>(env->CallStaticObjectMethod(SampleForTests_clazz(env), |
191 method_id)); | 191 method_id)); |
192 jni_generator::CheckException(env); | 192 jni_generator::CheckException(env); |
193 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 193 return ScopedJavaLocalRef<jstring>(env, ret); |
194 } | 194 } |
195 | 195 |
196 // Step 3: RegisterNatives. | 196 // Step 3: RegisterNatives. |
197 | 197 |
198 static const JNINativeMethod kMethodsMyOtherInnerClass[] = { | 198 static const JNINativeMethod kMethodsMyOtherInnerClass[] = { |
199 { "nativeInit", | 199 { "nativeInit", |
200 "(" | 200 "(" |
201 ")" | 201 ")" |
202 "I", | 202 "I", |
203 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe
sts_00024MyOtherInnerClass_nativeInit) | 203 reinterpret_cast<void*>(Java_org_chromium_example_jni_1generator_SampleForTe
sts_00024MyOtherInnerClass_nativeInit) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 return true; | 272 return true; |
273 } | 273 } |
274 | 274 |
275 extern "C" JNIEXPORT bool JNICALL | 275 extern "C" JNIEXPORT bool JNICALL |
276 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN
IEnv* | 276 Java_org_chromium_example_jni_1generator_SampleForTests_nativeInitNativeClass(JN
IEnv* |
277 env, jclass clazz) { | 277 env, jclass clazz) { |
278 return RegisterNativesImpl(env, clazz); | 278 return RegisterNativesImpl(env, clazz); |
279 } | 279 } |
280 | 280 |
281 #endif // org_chromium_example_jni_generator_SampleForTests_JNI | 281 #endif // org_chromium_example_jni_generator_SampleForTests_JNI |
OLD | NEW |