Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1119)

Side by Side Diff: android/jni_generator/testCalledByNatives.golden

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/TestJni 8 // org/chromium/TestJni
9 9
10 #ifndef org_chromium_TestJni_JNI 10 #ifndef org_chromium_TestJni_JNI
(...skipping 14 matching lines...) Expand all
25 #define TestJni_clazz(env) g_TestJni_clazz 25 #define TestJni_clazz(env) g_TestJni_clazz
26 // Leaking this jclass as we cannot use LazyInstance from some threads. 26 // Leaking this jclass as we cannot use LazyInstance from some threads.
27 jclass g_InfoBar_clazz = NULL; 27 jclass g_InfoBar_clazz = NULL;
28 #define InfoBar_clazz(env) g_InfoBar_clazz 28 #define InfoBar_clazz(env) g_InfoBar_clazz
29 29
30 } // namespace 30 } // namespace
31 31
32 // Step 2: method stubs. 32 // Step 2: method stubs.
33 33
34 static base::subtle::AtomicWord g_TestJni_showConfirmInfoBar = 0; 34 static base::subtle::AtomicWord g_TestJni_showConfirmInfoBar = 0;
35 static base::android::ScopedJavaLocalRef<jobject> 35 static ScopedJavaLocalRef<jobject> Java_TestJni_showConfirmInfoBar(JNIEnv* env,
36 Java_TestJni_showConfirmInfoBar(JNIEnv* env, jobject obj, JniIntWrapper 36 jobject obj, JniIntWrapper nativeInfoBar,
37 nativeInfoBar,
38 jstring buttonOk, 37 jstring buttonOk,
39 jstring buttonCancel, 38 jstring buttonCancel,
40 jstring title, 39 jstring title,
41 jobject icon) { 40 jobject icon) {
42 /* Must call RegisterNativesImpl() */ 41 /* Must call RegisterNativesImpl() */
43 CHECK_CLAZZ(env, obj, 42 CHECK_CLAZZ(env, obj,
44 TestJni_clazz(env), NULL); 43 TestJni_clazz(env), NULL);
45 jmethodID method_id = 44 jmethodID method_id =
46 base::android::MethodID::LazyGet< 45 base::android::MethodID::LazyGet<
47 base::android::MethodID::TYPE_INSTANCE>( 46 base::android::MethodID::TYPE_INSTANCE>(
48 env, TestJni_clazz(env), 47 env, TestJni_clazz(env),
49 "showConfirmInfoBar", 48 "showConfirmInfoBar",
50 49
51 "(" 50 "("
52 "I" 51 "I"
53 "Ljava/lang/String;" 52 "Ljava/lang/String;"
54 "Ljava/lang/String;" 53 "Ljava/lang/String;"
55 "Ljava/lang/String;" 54 "Ljava/lang/String;"
56 "Landroid/graphics/Bitmap;" 55 "Landroid/graphics/Bitmap;"
57 ")" 56 ")"
58 "Lorg/chromium/Foo$InnerClass;", 57 "Lorg/chromium/Foo$InnerClass;",
59 &g_TestJni_showConfirmInfoBar); 58 &g_TestJni_showConfirmInfoBar);
60 59
61 jobject ret = 60 jobject ret =
62 env->CallObjectMethod(obj, 61 env->CallObjectMethod(obj,
63 method_id, as_jint(nativeInfoBar), buttonOk, buttonCancel, title, 62 method_id, as_jint(nativeInfoBar), buttonOk, buttonCancel, title,
64 icon); 63 icon);
65 jni_generator::CheckException(env); 64 jni_generator::CheckException(env);
66 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 65 return ScopedJavaLocalRef<jobject>(env, ret);
67 } 66 }
68 67
69 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0; 68 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0;
70 static base::android::ScopedJavaLocalRef<jobject> 69 static ScopedJavaLocalRef<jobject> Java_TestJni_showAutoLoginInfoBar(JNIEnv*
71 Java_TestJni_showAutoLoginInfoBar(JNIEnv* env, jobject obj, JniIntWrapper 70 env, jobject obj, JniIntWrapper nativeInfoBar,
72 nativeInfoBar,
73 jstring realm, 71 jstring realm,
74 jstring account, 72 jstring account,
75 jstring args) { 73 jstring args) {
76 /* Must call RegisterNativesImpl() */ 74 /* Must call RegisterNativesImpl() */
77 CHECK_CLAZZ(env, obj, 75 CHECK_CLAZZ(env, obj,
78 TestJni_clazz(env), NULL); 76 TestJni_clazz(env), NULL);
79 jmethodID method_id = 77 jmethodID method_id =
80 base::android::MethodID::LazyGet< 78 base::android::MethodID::LazyGet<
81 base::android::MethodID::TYPE_INSTANCE>( 79 base::android::MethodID::TYPE_INSTANCE>(
82 env, TestJni_clazz(env), 80 env, TestJni_clazz(env),
83 "showAutoLoginInfoBar", 81 "showAutoLoginInfoBar",
84 82
85 "(" 83 "("
86 "I" 84 "I"
87 "Ljava/lang/String;" 85 "Ljava/lang/String;"
88 "Ljava/lang/String;" 86 "Ljava/lang/String;"
89 "Ljava/lang/String;" 87 "Ljava/lang/String;"
90 ")" 88 ")"
91 "Lorg/chromium/Foo$InnerClass;", 89 "Lorg/chromium/Foo$InnerClass;",
92 &g_TestJni_showAutoLoginInfoBar); 90 &g_TestJni_showAutoLoginInfoBar);
93 91
94 jobject ret = 92 jobject ret =
95 env->CallObjectMethod(obj, 93 env->CallObjectMethod(obj,
96 method_id, as_jint(nativeInfoBar), realm, account, args); 94 method_id, as_jint(nativeInfoBar), realm, account, args);
97 jni_generator::CheckException(env); 95 jni_generator::CheckException(env);
98 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 96 return ScopedJavaLocalRef<jobject>(env, ret);
99 } 97 }
100 98
101 static base::subtle::AtomicWord g_InfoBar_dismiss = 0; 99 static base::subtle::AtomicWord g_InfoBar_dismiss = 0;
102 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) { 100 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) {
103 /* Must call RegisterNativesImpl() */ 101 /* Must call RegisterNativesImpl() */
104 CHECK_CLAZZ(env, obj, 102 CHECK_CLAZZ(env, obj,
105 InfoBar_clazz(env)); 103 InfoBar_clazz(env));
106 jmethodID method_id = 104 jmethodID method_id =
107 base::android::MethodID::LazyGet< 105 base::android::MethodID::LazyGet<
108 base::android::MethodID::TYPE_INSTANCE>( 106 base::android::MethodID::TYPE_INSTANCE>(
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 &g_TestJni_shouldShowAutoLogin); 142 &g_TestJni_shouldShowAutoLogin);
145 143
146 jboolean ret = 144 jboolean ret =
147 env->CallStaticBooleanMethod(TestJni_clazz(env), 145 env->CallStaticBooleanMethod(TestJni_clazz(env),
148 method_id, view, realm, account, args); 146 method_id, view, realm, account, args);
149 jni_generator::CheckException(env); 147 jni_generator::CheckException(env);
150 return ret; 148 return ret;
151 } 149 }
152 150
153 static base::subtle::AtomicWord g_TestJni_openUrl = 0; 151 static base::subtle::AtomicWord g_TestJni_openUrl = 0;
154 static base::android::ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv* 152 static ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv* env, jstring
155 env, jstring url) { 153 url) {
156 /* Must call RegisterNativesImpl() */ 154 /* Must call RegisterNativesImpl() */
157 CHECK_CLAZZ(env, TestJni_clazz(env), 155 CHECK_CLAZZ(env, TestJni_clazz(env),
158 TestJni_clazz(env), NULL); 156 TestJni_clazz(env), NULL);
159 jmethodID method_id = 157 jmethodID method_id =
160 base::android::MethodID::LazyGet< 158 base::android::MethodID::LazyGet<
161 base::android::MethodID::TYPE_STATIC>( 159 base::android::MethodID::TYPE_STATIC>(
162 env, TestJni_clazz(env), 160 env, TestJni_clazz(env),
163 "openUrl", 161 "openUrl",
164 162
165 "(" 163 "("
166 "Ljava/lang/String;" 164 "Ljava/lang/String;"
167 ")" 165 ")"
168 "Ljava/io/InputStream;", 166 "Ljava/io/InputStream;",
169 &g_TestJni_openUrl); 167 &g_TestJni_openUrl);
170 168
171 jobject ret = 169 jobject ret =
172 env->CallStaticObjectMethod(TestJni_clazz(env), 170 env->CallStaticObjectMethod(TestJni_clazz(env),
173 method_id, url); 171 method_id, url);
174 jni_generator::CheckException(env); 172 jni_generator::CheckException(env);
175 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 173 return ScopedJavaLocalRef<jobject>(env, ret);
176 } 174 }
177 175
178 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0; 176 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0;
179 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj, 177 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj,
180 jboolean activated, 178 jboolean activated,
181 JniIntWrapper iPid, 179 JniIntWrapper iPid,
182 JniIntWrapper iType, 180 JniIntWrapper iType,
183 JniIntWrapper iPrimaryID, 181 JniIntWrapper iPrimaryID,
184 JniIntWrapper iSecondaryID) { 182 JniIntWrapper iSecondaryID) {
185 /* Must call RegisterNativesImpl() */ 183 /* Must call RegisterNativesImpl() */
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 ")" 223 ")"
226 "V", 224 "V",
227 &g_TestJni_uncheckedCall); 225 &g_TestJni_uncheckedCall);
228 226
229 env->CallVoidMethod(obj, 227 env->CallVoidMethod(obj,
230 method_id, as_jint(iParam)); 228 method_id, as_jint(iParam));
231 229
232 } 230 }
233 231
234 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0; 232 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0;
235 static base::android::ScopedJavaLocalRef<jbyteArray> 233 static ScopedJavaLocalRef<jbyteArray> Java_TestJni_returnByteArray(JNIEnv* env,
236 Java_TestJni_returnByteArray(JNIEnv* env, jobject obj) { 234 jobject obj) {
237 /* Must call RegisterNativesImpl() */ 235 /* Must call RegisterNativesImpl() */
238 CHECK_CLAZZ(env, obj, 236 CHECK_CLAZZ(env, obj,
239 TestJni_clazz(env), NULL); 237 TestJni_clazz(env), NULL);
240 jmethodID method_id = 238 jmethodID method_id =
241 base::android::MethodID::LazyGet< 239 base::android::MethodID::LazyGet<
242 base::android::MethodID::TYPE_INSTANCE>( 240 base::android::MethodID::TYPE_INSTANCE>(
243 env, TestJni_clazz(env), 241 env, TestJni_clazz(env),
244 "returnByteArray", 242 "returnByteArray",
245 243
246 "(" 244 "("
247 ")" 245 ")"
248 "[B", 246 "[B",
249 &g_TestJni_returnByteArray); 247 &g_TestJni_returnByteArray);
250 248
251 jbyteArray ret = 249 jbyteArray ret =
252 static_cast<jbyteArray>(env->CallObjectMethod(obj, 250 static_cast<jbyteArray>(env->CallObjectMethod(obj,
253 method_id)); 251 method_id));
254 jni_generator::CheckException(env); 252 jni_generator::CheckException(env);
255 return base::android::ScopedJavaLocalRef<jbyteArray>(env, ret); 253 return ScopedJavaLocalRef<jbyteArray>(env, ret);
256 } 254 }
257 255
258 static base::subtle::AtomicWord g_TestJni_returnBooleanArray = 0; 256 static base::subtle::AtomicWord g_TestJni_returnBooleanArray = 0;
259 static base::android::ScopedJavaLocalRef<jbooleanArray> 257 static ScopedJavaLocalRef<jbooleanArray> Java_TestJni_returnBooleanArray(JNIEnv*
260 Java_TestJni_returnBooleanArray(JNIEnv* env, jobject obj) { 258 env, jobject obj) {
261 /* Must call RegisterNativesImpl() */ 259 /* Must call RegisterNativesImpl() */
262 CHECK_CLAZZ(env, obj, 260 CHECK_CLAZZ(env, obj,
263 TestJni_clazz(env), NULL); 261 TestJni_clazz(env), NULL);
264 jmethodID method_id = 262 jmethodID method_id =
265 base::android::MethodID::LazyGet< 263 base::android::MethodID::LazyGet<
266 base::android::MethodID::TYPE_INSTANCE>( 264 base::android::MethodID::TYPE_INSTANCE>(
267 env, TestJni_clazz(env), 265 env, TestJni_clazz(env),
268 "returnBooleanArray", 266 "returnBooleanArray",
269 267
270 "(" 268 "("
271 ")" 269 ")"
272 "[Z", 270 "[Z",
273 &g_TestJni_returnBooleanArray); 271 &g_TestJni_returnBooleanArray);
274 272
275 jbooleanArray ret = 273 jbooleanArray ret =
276 static_cast<jbooleanArray>(env->CallObjectMethod(obj, 274 static_cast<jbooleanArray>(env->CallObjectMethod(obj,
277 method_id)); 275 method_id));
278 jni_generator::CheckException(env); 276 jni_generator::CheckException(env);
279 return base::android::ScopedJavaLocalRef<jbooleanArray>(env, ret); 277 return ScopedJavaLocalRef<jbooleanArray>(env, ret);
280 } 278 }
281 279
282 static base::subtle::AtomicWord g_TestJni_returnCharArray = 0; 280 static base::subtle::AtomicWord g_TestJni_returnCharArray = 0;
283 static base::android::ScopedJavaLocalRef<jcharArray> 281 static ScopedJavaLocalRef<jcharArray> Java_TestJni_returnCharArray(JNIEnv* env,
284 Java_TestJni_returnCharArray(JNIEnv* env, jobject obj) { 282 jobject obj) {
285 /* Must call RegisterNativesImpl() */ 283 /* Must call RegisterNativesImpl() */
286 CHECK_CLAZZ(env, obj, 284 CHECK_CLAZZ(env, obj,
287 TestJni_clazz(env), NULL); 285 TestJni_clazz(env), NULL);
288 jmethodID method_id = 286 jmethodID method_id =
289 base::android::MethodID::LazyGet< 287 base::android::MethodID::LazyGet<
290 base::android::MethodID::TYPE_INSTANCE>( 288 base::android::MethodID::TYPE_INSTANCE>(
291 env, TestJni_clazz(env), 289 env, TestJni_clazz(env),
292 "returnCharArray", 290 "returnCharArray",
293 291
294 "(" 292 "("
295 ")" 293 ")"
296 "[C", 294 "[C",
297 &g_TestJni_returnCharArray); 295 &g_TestJni_returnCharArray);
298 296
299 jcharArray ret = 297 jcharArray ret =
300 static_cast<jcharArray>(env->CallObjectMethod(obj, 298 static_cast<jcharArray>(env->CallObjectMethod(obj,
301 method_id)); 299 method_id));
302 jni_generator::CheckException(env); 300 jni_generator::CheckException(env);
303 return base::android::ScopedJavaLocalRef<jcharArray>(env, ret); 301 return ScopedJavaLocalRef<jcharArray>(env, ret);
304 } 302 }
305 303
306 static base::subtle::AtomicWord g_TestJni_returnShortArray = 0; 304 static base::subtle::AtomicWord g_TestJni_returnShortArray = 0;
307 static base::android::ScopedJavaLocalRef<jshortArray> 305 static ScopedJavaLocalRef<jshortArray> Java_TestJni_returnShortArray(JNIEnv*
308 Java_TestJni_returnShortArray(JNIEnv* env, jobject obj) { 306 env, jobject obj) {
309 /* Must call RegisterNativesImpl() */ 307 /* Must call RegisterNativesImpl() */
310 CHECK_CLAZZ(env, obj, 308 CHECK_CLAZZ(env, obj,
311 TestJni_clazz(env), NULL); 309 TestJni_clazz(env), NULL);
312 jmethodID method_id = 310 jmethodID method_id =
313 base::android::MethodID::LazyGet< 311 base::android::MethodID::LazyGet<
314 base::android::MethodID::TYPE_INSTANCE>( 312 base::android::MethodID::TYPE_INSTANCE>(
315 env, TestJni_clazz(env), 313 env, TestJni_clazz(env),
316 "returnShortArray", 314 "returnShortArray",
317 315
318 "(" 316 "("
319 ")" 317 ")"
320 "[S", 318 "[S",
321 &g_TestJni_returnShortArray); 319 &g_TestJni_returnShortArray);
322 320
323 jshortArray ret = 321 jshortArray ret =
324 static_cast<jshortArray>(env->CallObjectMethod(obj, 322 static_cast<jshortArray>(env->CallObjectMethod(obj,
325 method_id)); 323 method_id));
326 jni_generator::CheckException(env); 324 jni_generator::CheckException(env);
327 return base::android::ScopedJavaLocalRef<jshortArray>(env, ret); 325 return ScopedJavaLocalRef<jshortArray>(env, ret);
328 } 326 }
329 327
330 static base::subtle::AtomicWord g_TestJni_returnIntArray = 0; 328 static base::subtle::AtomicWord g_TestJni_returnIntArray = 0;
331 static base::android::ScopedJavaLocalRef<jintArray> 329 static ScopedJavaLocalRef<jintArray> Java_TestJni_returnIntArray(JNIEnv* env,
332 Java_TestJni_returnIntArray(JNIEnv* env, jobject obj) { 330 jobject obj) {
333 /* Must call RegisterNativesImpl() */ 331 /* Must call RegisterNativesImpl() */
334 CHECK_CLAZZ(env, obj, 332 CHECK_CLAZZ(env, obj,
335 TestJni_clazz(env), NULL); 333 TestJni_clazz(env), NULL);
336 jmethodID method_id = 334 jmethodID method_id =
337 base::android::MethodID::LazyGet< 335 base::android::MethodID::LazyGet<
338 base::android::MethodID::TYPE_INSTANCE>( 336 base::android::MethodID::TYPE_INSTANCE>(
339 env, TestJni_clazz(env), 337 env, TestJni_clazz(env),
340 "returnIntArray", 338 "returnIntArray",
341 339
342 "(" 340 "("
343 ")" 341 ")"
344 "[I", 342 "[I",
345 &g_TestJni_returnIntArray); 343 &g_TestJni_returnIntArray);
346 344
347 jintArray ret = 345 jintArray ret =
348 static_cast<jintArray>(env->CallObjectMethod(obj, 346 static_cast<jintArray>(env->CallObjectMethod(obj,
349 method_id)); 347 method_id));
350 jni_generator::CheckException(env); 348 jni_generator::CheckException(env);
351 return base::android::ScopedJavaLocalRef<jintArray>(env, ret); 349 return ScopedJavaLocalRef<jintArray>(env, ret);
352 } 350 }
353 351
354 static base::subtle::AtomicWord g_TestJni_returnLongArray = 0; 352 static base::subtle::AtomicWord g_TestJni_returnLongArray = 0;
355 static base::android::ScopedJavaLocalRef<jlongArray> 353 static ScopedJavaLocalRef<jlongArray> Java_TestJni_returnLongArray(JNIEnv* env,
356 Java_TestJni_returnLongArray(JNIEnv* env, jobject obj) { 354 jobject obj) {
357 /* Must call RegisterNativesImpl() */ 355 /* Must call RegisterNativesImpl() */
358 CHECK_CLAZZ(env, obj, 356 CHECK_CLAZZ(env, obj,
359 TestJni_clazz(env), NULL); 357 TestJni_clazz(env), NULL);
360 jmethodID method_id = 358 jmethodID method_id =
361 base::android::MethodID::LazyGet< 359 base::android::MethodID::LazyGet<
362 base::android::MethodID::TYPE_INSTANCE>( 360 base::android::MethodID::TYPE_INSTANCE>(
363 env, TestJni_clazz(env), 361 env, TestJni_clazz(env),
364 "returnLongArray", 362 "returnLongArray",
365 363
366 "(" 364 "("
367 ")" 365 ")"
368 "[J", 366 "[J",
369 &g_TestJni_returnLongArray); 367 &g_TestJni_returnLongArray);
370 368
371 jlongArray ret = 369 jlongArray ret =
372 static_cast<jlongArray>(env->CallObjectMethod(obj, 370 static_cast<jlongArray>(env->CallObjectMethod(obj,
373 method_id)); 371 method_id));
374 jni_generator::CheckException(env); 372 jni_generator::CheckException(env);
375 return base::android::ScopedJavaLocalRef<jlongArray>(env, ret); 373 return ScopedJavaLocalRef<jlongArray>(env, ret);
376 } 374 }
377 375
378 static base::subtle::AtomicWord g_TestJni_returnDoubleArray = 0; 376 static base::subtle::AtomicWord g_TestJni_returnDoubleArray = 0;
379 static base::android::ScopedJavaLocalRef<jdoubleArray> 377 static ScopedJavaLocalRef<jdoubleArray> Java_TestJni_returnDoubleArray(JNIEnv*
380 Java_TestJni_returnDoubleArray(JNIEnv* env, jobject obj) { 378 env, jobject obj) {
381 /* Must call RegisterNativesImpl() */ 379 /* Must call RegisterNativesImpl() */
382 CHECK_CLAZZ(env, obj, 380 CHECK_CLAZZ(env, obj,
383 TestJni_clazz(env), NULL); 381 TestJni_clazz(env), NULL);
384 jmethodID method_id = 382 jmethodID method_id =
385 base::android::MethodID::LazyGet< 383 base::android::MethodID::LazyGet<
386 base::android::MethodID::TYPE_INSTANCE>( 384 base::android::MethodID::TYPE_INSTANCE>(
387 env, TestJni_clazz(env), 385 env, TestJni_clazz(env),
388 "returnDoubleArray", 386 "returnDoubleArray",
389 387
390 "(" 388 "("
391 ")" 389 ")"
392 "[D", 390 "[D",
393 &g_TestJni_returnDoubleArray); 391 &g_TestJni_returnDoubleArray);
394 392
395 jdoubleArray ret = 393 jdoubleArray ret =
396 static_cast<jdoubleArray>(env->CallObjectMethod(obj, 394 static_cast<jdoubleArray>(env->CallObjectMethod(obj,
397 method_id)); 395 method_id));
398 jni_generator::CheckException(env); 396 jni_generator::CheckException(env);
399 return base::android::ScopedJavaLocalRef<jdoubleArray>(env, ret); 397 return ScopedJavaLocalRef<jdoubleArray>(env, ret);
400 } 398 }
401 399
402 static base::subtle::AtomicWord g_TestJni_returnObjectArray = 0; 400 static base::subtle::AtomicWord g_TestJni_returnObjectArray = 0;
403 static base::android::ScopedJavaLocalRef<jobjectArray> 401 static ScopedJavaLocalRef<jobjectArray> Java_TestJni_returnObjectArray(JNIEnv*
404 Java_TestJni_returnObjectArray(JNIEnv* env, jobject obj) { 402 env, jobject obj) {
405 /* Must call RegisterNativesImpl() */ 403 /* Must call RegisterNativesImpl() */
406 CHECK_CLAZZ(env, obj, 404 CHECK_CLAZZ(env, obj,
407 TestJni_clazz(env), NULL); 405 TestJni_clazz(env), NULL);
408 jmethodID method_id = 406 jmethodID method_id =
409 base::android::MethodID::LazyGet< 407 base::android::MethodID::LazyGet<
410 base::android::MethodID::TYPE_INSTANCE>( 408 base::android::MethodID::TYPE_INSTANCE>(
411 env, TestJni_clazz(env), 409 env, TestJni_clazz(env),
412 "returnObjectArray", 410 "returnObjectArray",
413 411
414 "(" 412 "("
415 ")" 413 ")"
416 "[Ljava/lang/Object;", 414 "[Ljava/lang/Object;",
417 &g_TestJni_returnObjectArray); 415 &g_TestJni_returnObjectArray);
418 416
419 jobjectArray ret = 417 jobjectArray ret =
420 static_cast<jobjectArray>(env->CallObjectMethod(obj, 418 static_cast<jobjectArray>(env->CallObjectMethod(obj,
421 method_id)); 419 method_id));
422 jni_generator::CheckException(env); 420 jni_generator::CheckException(env);
423 return base::android::ScopedJavaLocalRef<jobjectArray>(env, ret); 421 return ScopedJavaLocalRef<jobjectArray>(env, ret);
424 } 422 }
425 423
426 static base::subtle::AtomicWord g_TestJni_returnArrayOfByteArray = 0; 424 static base::subtle::AtomicWord g_TestJni_returnArrayOfByteArray = 0;
427 static base::android::ScopedJavaLocalRef<jobjectArray> 425 static ScopedJavaLocalRef<jobjectArray>
428 Java_TestJni_returnArrayOfByteArray(JNIEnv* env, jobject obj) { 426 Java_TestJni_returnArrayOfByteArray(JNIEnv* env, jobject obj) {
429 /* Must call RegisterNativesImpl() */ 427 /* Must call RegisterNativesImpl() */
430 CHECK_CLAZZ(env, obj, 428 CHECK_CLAZZ(env, obj,
431 TestJni_clazz(env), NULL); 429 TestJni_clazz(env), NULL);
432 jmethodID method_id = 430 jmethodID method_id =
433 base::android::MethodID::LazyGet< 431 base::android::MethodID::LazyGet<
434 base::android::MethodID::TYPE_INSTANCE>( 432 base::android::MethodID::TYPE_INSTANCE>(
435 env, TestJni_clazz(env), 433 env, TestJni_clazz(env),
436 "returnArrayOfByteArray", 434 "returnArrayOfByteArray",
437 435
438 "(" 436 "("
439 ")" 437 ")"
440 "[[B", 438 "[[B",
441 &g_TestJni_returnArrayOfByteArray); 439 &g_TestJni_returnArrayOfByteArray);
442 440
443 jobjectArray ret = 441 jobjectArray ret =
444 static_cast<jobjectArray>(env->CallObjectMethod(obj, 442 static_cast<jobjectArray>(env->CallObjectMethod(obj,
445 method_id)); 443 method_id));
446 jni_generator::CheckException(env); 444 jni_generator::CheckException(env);
447 return base::android::ScopedJavaLocalRef<jobjectArray>(env, ret); 445 return ScopedJavaLocalRef<jobjectArray>(env, ret);
448 } 446 }
449 447
450 static base::subtle::AtomicWord g_TestJni_getCompressFormat = 0; 448 static base::subtle::AtomicWord g_TestJni_getCompressFormat = 0;
451 static base::android::ScopedJavaLocalRef<jobject> 449 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormat(JNIEnv* env,
452 Java_TestJni_getCompressFormat(JNIEnv* env, jobject obj) { 450 jobject obj) {
453 /* Must call RegisterNativesImpl() */ 451 /* Must call RegisterNativesImpl() */
454 CHECK_CLAZZ(env, obj, 452 CHECK_CLAZZ(env, obj,
455 TestJni_clazz(env), NULL); 453 TestJni_clazz(env), NULL);
456 jmethodID method_id = 454 jmethodID method_id =
457 base::android::MethodID::LazyGet< 455 base::android::MethodID::LazyGet<
458 base::android::MethodID::TYPE_INSTANCE>( 456 base::android::MethodID::TYPE_INSTANCE>(
459 env, TestJni_clazz(env), 457 env, TestJni_clazz(env),
460 "getCompressFormat", 458 "getCompressFormat",
461 459
462 "(" 460 "("
463 ")" 461 ")"
464 "Landroid/graphics/Bitmap$CompressFormat;", 462 "Landroid/graphics/Bitmap$CompressFormat;",
465 &g_TestJni_getCompressFormat); 463 &g_TestJni_getCompressFormat);
466 464
467 jobject ret = 465 jobject ret =
468 env->CallObjectMethod(obj, 466 env->CallObjectMethod(obj,
469 method_id); 467 method_id);
470 jni_generator::CheckException(env); 468 jni_generator::CheckException(env);
471 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 469 return ScopedJavaLocalRef<jobject>(env, ret);
472 } 470 }
473 471
474 static base::subtle::AtomicWord g_TestJni_getCompressFormatList = 0; 472 static base::subtle::AtomicWord g_TestJni_getCompressFormatList = 0;
475 static base::android::ScopedJavaLocalRef<jobject> 473 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormatList(JNIEnv*
476 Java_TestJni_getCompressFormatList(JNIEnv* env, jobject obj) { 474 env, jobject obj) {
477 /* Must call RegisterNativesImpl() */ 475 /* Must call RegisterNativesImpl() */
478 CHECK_CLAZZ(env, obj, 476 CHECK_CLAZZ(env, obj,
479 TestJni_clazz(env), NULL); 477 TestJni_clazz(env), NULL);
480 jmethodID method_id = 478 jmethodID method_id =
481 base::android::MethodID::LazyGet< 479 base::android::MethodID::LazyGet<
482 base::android::MethodID::TYPE_INSTANCE>( 480 base::android::MethodID::TYPE_INSTANCE>(
483 env, TestJni_clazz(env), 481 env, TestJni_clazz(env),
484 "getCompressFormatList", 482 "getCompressFormatList",
485 483
486 "(" 484 "("
487 ")" 485 ")"
488 "Ljava/util/List;", 486 "Ljava/util/List;",
489 &g_TestJni_getCompressFormatList); 487 &g_TestJni_getCompressFormatList);
490 488
491 jobject ret = 489 jobject ret =
492 env->CallObjectMethod(obj, 490 env->CallObjectMethod(obj,
493 method_id); 491 method_id);
494 jni_generator::CheckException(env); 492 jni_generator::CheckException(env);
495 return base::android::ScopedJavaLocalRef<jobject>(env, ret); 493 return ScopedJavaLocalRef<jobject>(env, ret);
496 } 494 }
497 495
498 // Step 3: RegisterNatives. 496 // Step 3: RegisterNatives.
499 497
500 static bool RegisterNativesImpl(JNIEnv* env) { 498 static bool RegisterNativesImpl(JNIEnv* env) {
501 499
502 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( 500 g_TestJni_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
503 base::android::GetClass(env, kTestJniClassPath).obj())); 501 base::android::GetClass(env, kTestJniClassPath).obj()));
504 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( 502 g_InfoBar_clazz = reinterpret_cast<jclass>(env->NewGlobalRef(
505 base::android::GetClass(env, kInfoBarClassPath).obj())); 503 base::android::GetClass(env, kInfoBarClassPath).obj()));
506 504
507 return true; 505 return true;
508 } 506 }
509 507
510 #endif // org_chromium_TestJni_JNI 508 #endif // org_chromium_TestJni_JNI
OLDNEW
« no previous file with comments | « android/jni_generator/sample_for_tests.cc ('k') | android/jni_generator/testConstantsFromJavaP.golden » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698