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 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 static jint Java_SampleForTests_javaMethod(JNIEnv* env, const | 193 static jint Java_SampleForTests_javaMethod(JNIEnv* env, const |
194 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper foo, | 194 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper foo, |
195 JniIntWrapper bar) { | 195 JniIntWrapper bar) { |
196 CHECK_CLAZZ(env, obj.obj(), | 196 CHECK_CLAZZ(env, obj.obj(), |
197 SampleForTests_clazz(env), 0); | 197 SampleForTests_clazz(env), 0); |
198 jmethodID method_id = | 198 jmethodID method_id = |
199 base::android::MethodID::LazyGet< | 199 base::android::MethodID::LazyGet< |
200 base::android::MethodID::TYPE_INSTANCE>( | 200 base::android::MethodID::TYPE_INSTANCE>( |
201 env, SampleForTests_clazz(env), | 201 env, SampleForTests_clazz(env), |
202 "javaMethod", | 202 "javaMethod", |
203 | |
204 "(" | 203 "(" |
205 "I" | 204 "I" |
206 "I" | 205 "I" |
207 ")" | 206 ")" |
208 "I", | 207 "I", |
209 &g_SampleForTests_javaMethod); | 208 &g_SampleForTests_javaMethod); |
210 | 209 |
211 jint ret = | 210 jint ret = |
212 env->CallIntMethod(obj.obj(), | 211 env->CallIntMethod(obj.obj(), |
213 method_id, as_jint(foo), as_jint(bar)); | 212 method_id, as_jint(foo), as_jint(bar)); |
214 jni_generator::CheckException(env); | 213 jni_generator::CheckException(env); |
215 return ret; | 214 return ret; |
216 } | 215 } |
217 | 216 |
218 static base::subtle::AtomicWord g_SampleForTests_staticJavaMethod = 0; | 217 static base::subtle::AtomicWord g_SampleForTests_staticJavaMethod = 0; |
219 static jboolean Java_SampleForTests_staticJavaMethod(JNIEnv* env) { | 218 static jboolean Java_SampleForTests_staticJavaMethod(JNIEnv* env) { |
220 CHECK_CLAZZ(env, SampleForTests_clazz(env), | 219 CHECK_CLAZZ(env, SampleForTests_clazz(env), |
221 SampleForTests_clazz(env), false); | 220 SampleForTests_clazz(env), false); |
222 jmethodID method_id = | 221 jmethodID method_id = |
223 base::android::MethodID::LazyGet< | 222 base::android::MethodID::LazyGet< |
224 base::android::MethodID::TYPE_STATIC>( | 223 base::android::MethodID::TYPE_STATIC>( |
225 env, SampleForTests_clazz(env), | 224 env, SampleForTests_clazz(env), |
226 "staticJavaMethod", | 225 "staticJavaMethod", |
227 | |
228 "(" | 226 "(" |
229 ")" | 227 ")" |
230 "Z", | 228 "Z", |
231 &g_SampleForTests_staticJavaMethod); | 229 &g_SampleForTests_staticJavaMethod); |
232 | 230 |
233 jboolean ret = | 231 jboolean ret = |
234 env->CallStaticBooleanMethod(SampleForTests_clazz(env), | 232 env->CallStaticBooleanMethod(SampleForTests_clazz(env), |
235 method_id); | 233 method_id); |
236 jni_generator::CheckException(env); | 234 jni_generator::CheckException(env); |
237 return ret; | 235 return ret; |
238 } | 236 } |
239 | 237 |
240 static base::subtle::AtomicWord g_SampleForTests_packagePrivateJavaMethod = 0; | 238 static base::subtle::AtomicWord g_SampleForTests_packagePrivateJavaMethod = 0; |
241 static void Java_SampleForTests_packagePrivateJavaMethod(JNIEnv* env, const | 239 static void Java_SampleForTests_packagePrivateJavaMethod(JNIEnv* env, const |
242 base::android::JavaRefOrBare<jobject>& obj) { | 240 base::android::JavaRefOrBare<jobject>& obj) { |
243 CHECK_CLAZZ(env, obj.obj(), | 241 CHECK_CLAZZ(env, obj.obj(), |
244 SampleForTests_clazz(env)); | 242 SampleForTests_clazz(env)); |
245 jmethodID method_id = | 243 jmethodID method_id = |
246 base::android::MethodID::LazyGet< | 244 base::android::MethodID::LazyGet< |
247 base::android::MethodID::TYPE_INSTANCE>( | 245 base::android::MethodID::TYPE_INSTANCE>( |
248 env, SampleForTests_clazz(env), | 246 env, SampleForTests_clazz(env), |
249 "packagePrivateJavaMethod", | 247 "packagePrivateJavaMethod", |
250 | |
251 "(" | 248 "(" |
252 ")" | 249 ")" |
253 "V", | 250 "V", |
254 &g_SampleForTests_packagePrivateJavaMethod); | 251 &g_SampleForTests_packagePrivateJavaMethod); |
255 | 252 |
256 env->CallVoidMethod(obj.obj(), | 253 env->CallVoidMethod(obj.obj(), |
257 method_id); | 254 method_id); |
258 jni_generator::CheckException(env); | 255 jni_generator::CheckException(env); |
259 | |
260 } | 256 } |
261 | 257 |
262 static base::subtle::AtomicWord g_SampleForTests_methodThatThrowsException = 0; | 258 static base::subtle::AtomicWord g_SampleForTests_methodThatThrowsException = 0; |
263 static void Java_SampleForTests_methodThatThrowsException(JNIEnv* env, const | 259 static void Java_SampleForTests_methodThatThrowsException(JNIEnv* env, const |
264 base::android::JavaRefOrBare<jobject>& obj) { | 260 base::android::JavaRefOrBare<jobject>& obj) { |
265 CHECK_CLAZZ(env, obj.obj(), | 261 CHECK_CLAZZ(env, obj.obj(), |
266 SampleForTests_clazz(env)); | 262 SampleForTests_clazz(env)); |
267 jmethodID method_id = | 263 jmethodID method_id = |
268 base::android::MethodID::LazyGet< | 264 base::android::MethodID::LazyGet< |
269 base::android::MethodID::TYPE_INSTANCE>( | 265 base::android::MethodID::TYPE_INSTANCE>( |
270 env, SampleForTests_clazz(env), | 266 env, SampleForTests_clazz(env), |
271 "methodThatThrowsException", | 267 "methodThatThrowsException", |
272 | |
273 "(" | 268 "(" |
274 ")" | 269 ")" |
275 "V", | 270 "V", |
276 &g_SampleForTests_methodThatThrowsException); | 271 &g_SampleForTests_methodThatThrowsException); |
277 | 272 |
278 env->CallVoidMethod(obj.obj(), | 273 env->CallVoidMethod(obj.obj(), |
279 method_id); | 274 method_id); |
280 | |
281 } | 275 } |
282 | 276 |
283 static base::subtle::AtomicWord g_SampleForTests_javaMethodWithAnnotatedParam = | 277 static base::subtle::AtomicWord g_SampleForTests_javaMethodWithAnnotatedParam = |
284 0; | 278 0; |
285 static void Java_SampleForTests_javaMethodWithAnnotatedParam(JNIEnv* env, const | 279 static void Java_SampleForTests_javaMethodWithAnnotatedParam(JNIEnv* env, const |
286 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper foo) { | 280 base::android::JavaRefOrBare<jobject>& obj, JniIntWrapper foo) { |
287 CHECK_CLAZZ(env, obj.obj(), | 281 CHECK_CLAZZ(env, obj.obj(), |
288 SampleForTests_clazz(env)); | 282 SampleForTests_clazz(env)); |
289 jmethodID method_id = | 283 jmethodID method_id = |
290 base::android::MethodID::LazyGet< | 284 base::android::MethodID::LazyGet< |
291 base::android::MethodID::TYPE_INSTANCE>( | 285 base::android::MethodID::TYPE_INSTANCE>( |
292 env, SampleForTests_clazz(env), | 286 env, SampleForTests_clazz(env), |
293 "javaMethodWithAnnotatedParam", | 287 "javaMethodWithAnnotatedParam", |
294 | |
295 "(" | 288 "(" |
296 "I" | 289 "I" |
297 ")" | 290 ")" |
298 "V", | 291 "V", |
299 &g_SampleForTests_javaMethodWithAnnotatedParam); | 292 &g_SampleForTests_javaMethodWithAnnotatedParam); |
300 | 293 |
301 env->CallVoidMethod(obj.obj(), | 294 env->CallVoidMethod(obj.obj(), |
302 method_id, as_jint(foo)); | 295 method_id, as_jint(foo)); |
303 jni_generator::CheckException(env); | 296 jni_generator::CheckException(env); |
304 | |
305 } | 297 } |
306 | 298 |
307 static base::subtle::AtomicWord g_InnerStructA_create = 0; | 299 static base::subtle::AtomicWord g_InnerStructA_create = 0; |
308 static base::android::ScopedJavaLocalRef<jobject> | 300 static base::android::ScopedJavaLocalRef<jobject> |
309 Java_InnerStructA_create(JNIEnv* env, jlong l, | 301 Java_InnerStructA_create(JNIEnv* env, jlong l, |
310 JniIntWrapper i, | 302 JniIntWrapper i, |
311 const base::android::JavaRefOrBare<jstring>& s) { | 303 const base::android::JavaRefOrBare<jstring>& s) { |
312 CHECK_CLAZZ(env, InnerStructA_clazz(env), | 304 CHECK_CLAZZ(env, InnerStructA_clazz(env), |
313 InnerStructA_clazz(env), NULL); | 305 InnerStructA_clazz(env), NULL); |
314 jmethodID method_id = | 306 jmethodID method_id = |
315 base::android::MethodID::LazyGet< | 307 base::android::MethodID::LazyGet< |
316 base::android::MethodID::TYPE_STATIC>( | 308 base::android::MethodID::TYPE_STATIC>( |
317 env, InnerStructA_clazz(env), | 309 env, InnerStructA_clazz(env), |
318 "create", | 310 "create", |
319 | |
320 "(" | 311 "(" |
321 "J" | 312 "J" |
322 "I" | 313 "I" |
323 "Ljava/lang/String;" | 314 "Ljava/lang/String;" |
324 ")" | 315 ")" |
325 "Lorg/chromium/example/jni_generator/SampleForTests$InnerStructA;", | 316 "Lorg/chromium/example/jni_generator/SampleForTests$InnerStructA;", |
326 &g_InnerStructA_create); | 317 &g_InnerStructA_create); |
327 | 318 |
328 jobject ret = | 319 jobject ret = |
329 env->CallStaticObjectMethod(InnerStructA_clazz(env), | 320 env->CallStaticObjectMethod(InnerStructA_clazz(env), |
330 method_id, l, as_jint(i), s.obj()); | 321 method_id, l, as_jint(i), s.obj()); |
331 jni_generator::CheckException(env); | 322 jni_generator::CheckException(env); |
332 return base::android::ScopedJavaLocalRef<jobject>(env, ret); | 323 return base::android::ScopedJavaLocalRef<jobject>(env, ret); |
333 } | 324 } |
334 | 325 |
335 static base::subtle::AtomicWord g_SampleForTests_addStructA = 0; | 326 static base::subtle::AtomicWord g_SampleForTests_addStructA = 0; |
336 static void Java_SampleForTests_addStructA(JNIEnv* env, const | 327 static void Java_SampleForTests_addStructA(JNIEnv* env, const |
337 base::android::JavaRefOrBare<jobject>& obj, const | 328 base::android::JavaRefOrBare<jobject>& obj, const |
338 base::android::JavaRefOrBare<jobject>& a) { | 329 base::android::JavaRefOrBare<jobject>& a) { |
339 CHECK_CLAZZ(env, obj.obj(), | 330 CHECK_CLAZZ(env, obj.obj(), |
340 SampleForTests_clazz(env)); | 331 SampleForTests_clazz(env)); |
341 jmethodID method_id = | 332 jmethodID method_id = |
342 base::android::MethodID::LazyGet< | 333 base::android::MethodID::LazyGet< |
343 base::android::MethodID::TYPE_INSTANCE>( | 334 base::android::MethodID::TYPE_INSTANCE>( |
344 env, SampleForTests_clazz(env), | 335 env, SampleForTests_clazz(env), |
345 "addStructA", | 336 "addStructA", |
346 | |
347 "(" | 337 "(" |
348 "Lorg/chromium/example/jni_generator/SampleForTests$InnerStructA;" | 338 "Lorg/chromium/example/jni_generator/SampleForTests$InnerStructA;" |
349 ")" | 339 ")" |
350 "V", | 340 "V", |
351 &g_SampleForTests_addStructA); | 341 &g_SampleForTests_addStructA); |
352 | 342 |
353 env->CallVoidMethod(obj.obj(), | 343 env->CallVoidMethod(obj.obj(), |
354 method_id, a.obj()); | 344 method_id, a.obj()); |
355 jni_generator::CheckException(env); | 345 jni_generator::CheckException(env); |
356 | |
357 } | 346 } |
358 | 347 |
359 static base::subtle::AtomicWord g_SampleForTests_iterateAndDoSomething = 0; | 348 static base::subtle::AtomicWord g_SampleForTests_iterateAndDoSomething = 0; |
360 static void Java_SampleForTests_iterateAndDoSomething(JNIEnv* env, const | 349 static void Java_SampleForTests_iterateAndDoSomething(JNIEnv* env, const |
361 base::android::JavaRefOrBare<jobject>& obj) { | 350 base::android::JavaRefOrBare<jobject>& obj) { |
362 CHECK_CLAZZ(env, obj.obj(), | 351 CHECK_CLAZZ(env, obj.obj(), |
363 SampleForTests_clazz(env)); | 352 SampleForTests_clazz(env)); |
364 jmethodID method_id = | 353 jmethodID method_id = |
365 base::android::MethodID::LazyGet< | 354 base::android::MethodID::LazyGet< |
366 base::android::MethodID::TYPE_INSTANCE>( | 355 base::android::MethodID::TYPE_INSTANCE>( |
367 env, SampleForTests_clazz(env), | 356 env, SampleForTests_clazz(env), |
368 "iterateAndDoSomething", | 357 "iterateAndDoSomething", |
369 | |
370 "(" | 358 "(" |
371 ")" | 359 ")" |
372 "V", | 360 "V", |
373 &g_SampleForTests_iterateAndDoSomething); | 361 &g_SampleForTests_iterateAndDoSomething); |
374 | 362 |
375 env->CallVoidMethod(obj.obj(), | 363 env->CallVoidMethod(obj.obj(), |
376 method_id); | 364 method_id); |
377 jni_generator::CheckException(env); | 365 jni_generator::CheckException(env); |
378 | |
379 } | 366 } |
380 | 367 |
381 static base::subtle::AtomicWord g_InnerStructB_getKey = 0; | 368 static base::subtle::AtomicWord g_InnerStructB_getKey = 0; |
382 static jlong Java_InnerStructB_getKey(JNIEnv* env, const | 369 static jlong Java_InnerStructB_getKey(JNIEnv* env, const |
383 base::android::JavaRefOrBare<jobject>& obj) { | 370 base::android::JavaRefOrBare<jobject>& obj) { |
384 CHECK_CLAZZ(env, obj.obj(), | 371 CHECK_CLAZZ(env, obj.obj(), |
385 InnerStructB_clazz(env), 0); | 372 InnerStructB_clazz(env), 0); |
386 jmethodID method_id = | 373 jmethodID method_id = |
387 base::android::MethodID::LazyGet< | 374 base::android::MethodID::LazyGet< |
388 base::android::MethodID::TYPE_INSTANCE>( | 375 base::android::MethodID::TYPE_INSTANCE>( |
389 env, InnerStructB_clazz(env), | 376 env, InnerStructB_clazz(env), |
390 "getKey", | 377 "getKey", |
391 | |
392 "(" | 378 "(" |
393 ")" | 379 ")" |
394 "J", | 380 "J", |
395 &g_InnerStructB_getKey); | 381 &g_InnerStructB_getKey); |
396 | 382 |
397 jlong ret = | 383 jlong ret = |
398 env->CallLongMethod(obj.obj(), | 384 env->CallLongMethod(obj.obj(), |
399 method_id); | 385 method_id); |
400 jni_generator::CheckException(env); | 386 jni_generator::CheckException(env); |
401 return ret; | 387 return ret; |
402 } | 388 } |
403 | 389 |
404 static base::subtle::AtomicWord g_InnerStructB_getValue = 0; | 390 static base::subtle::AtomicWord g_InnerStructB_getValue = 0; |
405 static base::android::ScopedJavaLocalRef<jstring> | 391 static base::android::ScopedJavaLocalRef<jstring> |
406 Java_InnerStructB_getValue(JNIEnv* env, const | 392 Java_InnerStructB_getValue(JNIEnv* env, const |
407 base::android::JavaRefOrBare<jobject>& obj) { | 393 base::android::JavaRefOrBare<jobject>& obj) { |
408 CHECK_CLAZZ(env, obj.obj(), | 394 CHECK_CLAZZ(env, obj.obj(), |
409 InnerStructB_clazz(env), NULL); | 395 InnerStructB_clazz(env), NULL); |
410 jmethodID method_id = | 396 jmethodID method_id = |
411 base::android::MethodID::LazyGet< | 397 base::android::MethodID::LazyGet< |
412 base::android::MethodID::TYPE_INSTANCE>( | 398 base::android::MethodID::TYPE_INSTANCE>( |
413 env, InnerStructB_clazz(env), | 399 env, InnerStructB_clazz(env), |
414 "getValue", | 400 "getValue", |
415 | |
416 "(" | 401 "(" |
417 ")" | 402 ")" |
418 "Ljava/lang/String;", | 403 "Ljava/lang/String;", |
419 &g_InnerStructB_getValue); | 404 &g_InnerStructB_getValue); |
420 | 405 |
421 jstring ret = | 406 jstring ret = |
422 static_cast<jstring>(env->CallObjectMethod(obj.obj(), | 407 static_cast<jstring>(env->CallObjectMethod(obj.obj(), |
423 method_id)); | 408 method_id)); |
424 jni_generator::CheckException(env); | 409 jni_generator::CheckException(env); |
425 return base::android::ScopedJavaLocalRef<jstring>(env, ret); | 410 return base::android::ScopedJavaLocalRef<jstring>(env, ret); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
537 return false; | 522 return false; |
538 } | 523 } |
539 | 524 |
540 return true; | 525 return true; |
541 } | 526 } |
542 | 527 |
543 } // namespace android | 528 } // namespace android |
544 } // namespace base | 529 } // namespace base |
545 | 530 |
546 #endif // org_chromium_example_jni_generator_SampleForTests_JNI | 531 #endif // org_chromium_example_jni_generator_SampleForTests_JNI |
OLD | NEW |