| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/TestJni | 8 // org/chromium/TestJni |
| 9 | 9 |
| 10 #ifndef org_chromium_TestJni_JNI | 10 #ifndef org_chromium_TestJni_JNI |
| 11 #define org_chromium_TestJni_JNI | 11 #define org_chromium_TestJni_JNI |
| 12 | 12 |
| 13 #include <jni.h> | 13 #include <jni.h> |
| 14 | 14 |
| 15 #include "base/android/jni_generator/jni_generator_helper.h" | 15 #include "base/android/jni_generator/jni_generator_helper.h" |
| 16 | 16 |
| 17 // Step 1: forward declarations. | 17 // Step 1: forward declarations. |
| 18 namespace { | 18 namespace { |
| 19 const char kTestJniClassPath[] = "org/chromium/TestJni"; | 19 const char kTestJniClassPath[] = "org/chromium/TestJni"; |
| 20 const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar"; | 20 const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar"; |
| 21 // Leaking this jclass as we cannot use LazyInstance from some threads. | 21 // Leaking this jclass as we cannot use LazyInstance from some threads. |
| 22 jclass g_TestJni_clazz = NULL; | 22 jclass g_TestJni_clazz = NULL; |
| 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 jclass g_InfoBar_clazz = NULL; | 24 jclass g_InfoBar_clazz = NULL; |
| 25 | 25 |
| 26 } // namespace | 26 } // namespace |
| 27 | 27 |
| 28 extern "C"{ |
| 29 |
| 28 // Step 2: method stubs. | 30 // Step 2: method stubs. |
| 29 | 31 |
| 30 static base::subtle::AtomicWord g_TestJni_showConfirmInfoBar = 0; | 32 static base::subtle::AtomicWord g_TestJni_showConfirmInfoBar = 0; |
| 31 static base::android::ScopedJavaLocalRef<jobject> | 33 static base::android::ScopedJavaLocalRef<jobject> |
| 32 Java_TestJni_showConfirmInfoBar(JNIEnv* env, jobject obj, jint | 34 Java_TestJni_showConfirmInfoBar(JNIEnv* env, jobject obj, jint |
| 33 nativeInfoBar, | 35 nativeInfoBar, |
| 34 jstring buttonOk, | 36 jstring buttonOk, |
| 35 jstring buttonCancel, | 37 jstring buttonCancel, |
| 36 jstring title, | 38 jstring title, |
| 37 jobject icon) { | 39 jobject icon) { |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 480 ")" | 482 ")" |
| 481 "Ljava/util/List;", | 483 "Ljava/util/List;", |
| 482 &g_TestJni_getCompressFormatList); | 484 &g_TestJni_getCompressFormatList); |
| 483 | 485 |
| 484 jobject ret = | 486 jobject ret = |
| 485 env->CallObjectMethod(obj, | 487 env->CallObjectMethod(obj, |
| 486 method_id); | 488 method_id); |
| 487 jni_generator::CheckException(env); | 489 jni_generator::CheckException(env); |
| 488 return base::android::ScopedJavaLocalRef<jobject>(env, ret); | 490 return base::android::ScopedJavaLocalRef<jobject>(env, ret); |
| 489 } | 491 } |
| 492 }; |
| 490 | 493 |
| 491 // Step 3: RegisterNatives. | 494 // Step 3: RegisterNatives. |
| 492 | |
| 493 static bool RegisterNativesImpl(JNIEnv* env) { | 495 static bool RegisterNativesImpl(JNIEnv* env) { |
| 494 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 496 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
| 495 base::android::GetClass(env, kTestJniClassPath).obj())); | 497 base::android::GetClass(env, kTestJniClassPath).obj())); |
| 496 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 498 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
| 497 base::android::GetClass(env, kInfoBarClassPath).obj())); | 499 base::android::GetClass(env, kInfoBarClassPath).obj())); |
| 498 | 500 |
| 499 return true; | 501 return true; |
| 500 } | 502 } |
| 501 | 503 |
| 502 #endif // org_chromium_TestJni_JNI | 504 #endif // org_chromium_TestJni_JNI |
| OLD | NEW |