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 #include "base/android/jni_int_wrapper.h" |
| 18 |
17 // Step 1: forward declarations. | 19 // Step 1: forward declarations. |
18 namespace { | 20 namespace { |
19 const char kTestJniClassPath[] = "org/chromium/TestJni"; | 21 const char kTestJniClassPath[] = "org/chromium/TestJni"; |
20 const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar"; | 22 const char kInfoBarClassPath[] = "org/chromium/TestJni$InfoBar"; |
21 // Leaking this jclass as we cannot use LazyInstance from some threads. | 23 // Leaking this jclass as we cannot use LazyInstance from some threads. |
22 jclass g_TestJni_clazz = NULL; | 24 jclass g_TestJni_clazz = NULL; |
23 // Leaking this jclass as we cannot use LazyInstance from some threads. | 25 // Leaking this jclass as we cannot use LazyInstance from some threads. |
24 jclass g_InfoBar_clazz = NULL; | 26 jclass g_InfoBar_clazz = NULL; |
25 | 27 |
26 } // namespace | 28 } // namespace |
27 | 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, JniIntWrapper |
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) { |
38 /* Must call RegisterNativesImpl() */ | 40 /* Must call RegisterNativesImpl() */ |
39 CHECK_CLAZZ(env, obj, | 41 CHECK_CLAZZ(env, obj, |
40 g_TestJni_clazz, NULL); | 42 g_TestJni_clazz, NULL); |
41 jmethodID method_id = | 43 jmethodID method_id = |
42 base::android::MethodID::LazyGet< | 44 base::android::MethodID::LazyGet< |
43 base::android::MethodID::TYPE_INSTANCE>( | 45 base::android::MethodID::TYPE_INSTANCE>( |
44 env, g_TestJni_clazz, | 46 env, g_TestJni_clazz, |
45 "showConfirmInfoBar", | 47 "showConfirmInfoBar", |
46 | 48 |
47 "(" | 49 "(" |
48 "I" | 50 "I" |
49 "Ljava/lang/String;" | 51 "Ljava/lang/String;" |
50 "Ljava/lang/String;" | 52 "Ljava/lang/String;" |
51 "Ljava/lang/String;" | 53 "Ljava/lang/String;" |
52 "Landroid/graphics/Bitmap;" | 54 "Landroid/graphics/Bitmap;" |
53 ")" | 55 ")" |
54 "Lorg/chromium/Foo$InnerClass;", | 56 "Lorg/chromium/Foo$InnerClass;", |
55 &g_TestJni_showConfirmInfoBar); | 57 &g_TestJni_showConfirmInfoBar); |
56 | 58 |
57 jobject ret = | 59 jobject ret = |
58 env->CallObjectMethod(obj, | 60 env->CallObjectMethod(obj, |
59 method_id, nativeInfoBar, buttonOk, buttonCancel, title, icon); | 61 method_id, as_jint(nativeInfoBar), buttonOk, buttonCancel, title, |
| 62 icon); |
60 jni_generator::CheckException(env); | 63 jni_generator::CheckException(env); |
61 return base::android::ScopedJavaLocalRef<jobject>(env, ret); | 64 return base::android::ScopedJavaLocalRef<jobject>(env, ret); |
62 } | 65 } |
63 | 66 |
64 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0; | 67 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0; |
65 static base::android::ScopedJavaLocalRef<jobject> | 68 static base::android::ScopedJavaLocalRef<jobject> |
66 Java_TestJni_showAutoLoginInfoBar(JNIEnv* env, jobject obj, jint | 69 Java_TestJni_showAutoLoginInfoBar(JNIEnv* env, jobject obj, JniIntWrapper |
67 nativeInfoBar, | 70 nativeInfoBar, |
68 jstring realm, | 71 jstring realm, |
69 jstring account, | 72 jstring account, |
70 jstring args) { | 73 jstring args) { |
71 /* Must call RegisterNativesImpl() */ | 74 /* Must call RegisterNativesImpl() */ |
72 CHECK_CLAZZ(env, obj, | 75 CHECK_CLAZZ(env, obj, |
73 g_TestJni_clazz, NULL); | 76 g_TestJni_clazz, NULL); |
74 jmethodID method_id = | 77 jmethodID method_id = |
75 base::android::MethodID::LazyGet< | 78 base::android::MethodID::LazyGet< |
76 base::android::MethodID::TYPE_INSTANCE>( | 79 base::android::MethodID::TYPE_INSTANCE>( |
77 env, g_TestJni_clazz, | 80 env, g_TestJni_clazz, |
78 "showAutoLoginInfoBar", | 81 "showAutoLoginInfoBar", |
79 | 82 |
80 "(" | 83 "(" |
81 "I" | 84 "I" |
82 "Ljava/lang/String;" | 85 "Ljava/lang/String;" |
83 "Ljava/lang/String;" | 86 "Ljava/lang/String;" |
84 "Ljava/lang/String;" | 87 "Ljava/lang/String;" |
85 ")" | 88 ")" |
86 "Lorg/chromium/Foo$InnerClass;", | 89 "Lorg/chromium/Foo$InnerClass;", |
87 &g_TestJni_showAutoLoginInfoBar); | 90 &g_TestJni_showAutoLoginInfoBar); |
88 | 91 |
89 jobject ret = | 92 jobject ret = |
90 env->CallObjectMethod(obj, | 93 env->CallObjectMethod(obj, |
91 method_id, nativeInfoBar, realm, account, args); | 94 method_id, as_jint(nativeInfoBar), realm, account, args); |
92 jni_generator::CheckException(env); | 95 jni_generator::CheckException(env); |
93 return base::android::ScopedJavaLocalRef<jobject>(env, ret); | 96 return base::android::ScopedJavaLocalRef<jobject>(env, ret); |
94 } | 97 } |
95 | 98 |
96 static base::subtle::AtomicWord g_InfoBar_dismiss = 0; | 99 static base::subtle::AtomicWord g_InfoBar_dismiss = 0; |
97 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) { | 100 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) { |
98 /* Must call RegisterNativesImpl() */ | 101 /* Must call RegisterNativesImpl() */ |
99 CHECK_CLAZZ(env, obj, | 102 CHECK_CLAZZ(env, obj, |
100 g_InfoBar_clazz); | 103 g_InfoBar_clazz); |
101 jmethodID method_id = | 104 jmethodID method_id = |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 jobject ret = | 169 jobject ret = |
167 env->CallStaticObjectMethod(g_TestJni_clazz, | 170 env->CallStaticObjectMethod(g_TestJni_clazz, |
168 method_id, url); | 171 method_id, url); |
169 jni_generator::CheckException(env); | 172 jni_generator::CheckException(env); |
170 return base::android::ScopedJavaLocalRef<jobject>(env, ret); | 173 return base::android::ScopedJavaLocalRef<jobject>(env, ret); |
171 } | 174 } |
172 | 175 |
173 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0; | 176 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0; |
174 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj, | 177 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj, |
175 jboolean activated, | 178 jboolean activated, |
176 jint iPid, | 179 JniIntWrapper iPid, |
177 jint iType, | 180 JniIntWrapper iType, |
178 jint iPrimaryID, | 181 JniIntWrapper iPrimaryID, |
179 jint iSecondaryID) { | 182 JniIntWrapper iSecondaryID) { |
180 /* Must call RegisterNativesImpl() */ | 183 /* Must call RegisterNativesImpl() */ |
181 CHECK_CLAZZ(env, obj, | 184 CHECK_CLAZZ(env, obj, |
182 g_TestJni_clazz); | 185 g_TestJni_clazz); |
183 jmethodID method_id = | 186 jmethodID method_id = |
184 base::android::MethodID::LazyGet< | 187 base::android::MethodID::LazyGet< |
185 base::android::MethodID::TYPE_INSTANCE>( | 188 base::android::MethodID::TYPE_INSTANCE>( |
186 env, g_TestJni_clazz, | 189 env, g_TestJni_clazz, |
187 "activateHardwareAcceleration", | 190 "activateHardwareAcceleration", |
188 | 191 |
189 "(" | 192 "(" |
190 "Z" | 193 "Z" |
191 "I" | 194 "I" |
192 "I" | 195 "I" |
193 "I" | 196 "I" |
194 "I" | 197 "I" |
195 ")" | 198 ")" |
196 "V", | 199 "V", |
197 &g_TestJni_activateHardwareAcceleration); | 200 &g_TestJni_activateHardwareAcceleration); |
198 | 201 |
199 env->CallVoidMethod(obj, | 202 env->CallVoidMethod(obj, |
200 method_id, activated, iPid, iType, iPrimaryID, iSecondaryID); | 203 method_id, activated, as_jint(iPid), as_jint(iType), |
| 204 as_jint(iPrimaryID), as_jint(iSecondaryID)); |
201 jni_generator::CheckException(env); | 205 jni_generator::CheckException(env); |
202 | 206 |
203 } | 207 } |
204 | 208 |
205 static base::subtle::AtomicWord g_TestJni_uncheckedCall = 0; | 209 static base::subtle::AtomicWord g_TestJni_uncheckedCall = 0; |
206 static void Java_TestJni_uncheckedCall(JNIEnv* env, jobject obj, jint iParam) { | 210 static void Java_TestJni_uncheckedCall(JNIEnv* env, jobject obj, JniIntWrapper |
| 211 iParam) { |
207 /* Must call RegisterNativesImpl() */ | 212 /* Must call RegisterNativesImpl() */ |
208 CHECK_CLAZZ(env, obj, | 213 CHECK_CLAZZ(env, obj, |
209 g_TestJni_clazz); | 214 g_TestJni_clazz); |
210 jmethodID method_id = | 215 jmethodID method_id = |
211 base::android::MethodID::LazyGet< | 216 base::android::MethodID::LazyGet< |
212 base::android::MethodID::TYPE_INSTANCE>( | 217 base::android::MethodID::TYPE_INSTANCE>( |
213 env, g_TestJni_clazz, | 218 env, g_TestJni_clazz, |
214 "uncheckedCall", | 219 "uncheckedCall", |
215 | 220 |
216 "(" | 221 "(" |
217 "I" | 222 "I" |
218 ")" | 223 ")" |
219 "V", | 224 "V", |
220 &g_TestJni_uncheckedCall); | 225 &g_TestJni_uncheckedCall); |
221 | 226 |
222 env->CallVoidMethod(obj, | 227 env->CallVoidMethod(obj, |
223 method_id, iParam); | 228 method_id, as_jint(iParam)); |
224 | 229 |
225 } | 230 } |
226 | 231 |
227 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0; | 232 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0; |
228 static base::android::ScopedJavaLocalRef<jbyteArray> | 233 static base::android::ScopedJavaLocalRef<jbyteArray> |
229 Java_TestJni_returnByteArray(JNIEnv* env, jobject obj) { | 234 Java_TestJni_returnByteArray(JNIEnv* env, jobject obj) { |
230 /* Must call RegisterNativesImpl() */ | 235 /* Must call RegisterNativesImpl() */ |
231 CHECK_CLAZZ(env, obj, | 236 CHECK_CLAZZ(env, obj, |
232 g_TestJni_clazz, NULL); | 237 g_TestJni_clazz, NULL); |
233 jmethodID method_id = | 238 jmethodID method_id = |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
493 static bool RegisterNativesImpl(JNIEnv* env) { | 498 static bool RegisterNativesImpl(JNIEnv* env) { |
494 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 499 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
495 base::android::GetClass(env, kTestJniClassPath).obj())); | 500 base::android::GetClass(env, kTestJniClassPath).obj())); |
496 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 501 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
497 base::android::GetClass(env, kInfoBarClassPath).obj())); | 502 base::android::GetClass(env, kInfoBarClassPath).obj())); |
498 | 503 |
499 return true; | 504 return true; |
500 } | 505 } |
501 | 506 |
502 #endif // org_chromium_TestJni_JNI | 507 #endif // org_chromium_TestJni_JNI |
OLD | NEW |