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

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

Issue 2204623002: Android: Don't require RegisterNatives if there are none (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 20 matching lines...) Expand all
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 ScopedJavaLocalRef<jobject> Java_TestJni_showConfirmInfoBar(JNIEnv* env, 35 static ScopedJavaLocalRef<jobject> Java_TestJni_showConfirmInfoBar(JNIEnv* env,
36 jobject obj, JniIntWrapper nativeInfoBar, 36 jobject obj, JniIntWrapper nativeInfoBar,
37 jstring buttonOk, 37 jstring buttonOk,
38 jstring buttonCancel, 38 jstring buttonCancel,
39 jstring title, 39 jstring title,
40 jobject icon) { 40 jobject icon) {
41 /* Must call RegisterNativesImpl() */
42 CHECK_CLAZZ(env, obj, 41 CHECK_CLAZZ(env, obj,
43 TestJni_clazz(env), NULL); 42 TestJni_clazz(env), NULL);
44 jmethodID method_id = 43 jmethodID method_id =
45 base::android::MethodID::LazyGet< 44 base::android::MethodID::LazyGet<
46 base::android::MethodID::TYPE_INSTANCE>( 45 base::android::MethodID::TYPE_INSTANCE>(
47 env, TestJni_clazz(env), 46 env, TestJni_clazz(env),
48 "showConfirmInfoBar", 47 "showConfirmInfoBar",
49 48
50 "(" 49 "("
51 "I" 50 "I"
(...skipping 12 matching lines...) Expand all
64 jni_generator::CheckException(env); 63 jni_generator::CheckException(env);
65 return ScopedJavaLocalRef<jobject>(env, ret); 64 return ScopedJavaLocalRef<jobject>(env, ret);
66 } 65 }
67 66
68 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0; 67 static base::subtle::AtomicWord g_TestJni_showAutoLoginInfoBar = 0;
69 static ScopedJavaLocalRef<jobject> Java_TestJni_showAutoLoginInfoBar(JNIEnv* 68 static ScopedJavaLocalRef<jobject> Java_TestJni_showAutoLoginInfoBar(JNIEnv*
70 env, jobject obj, JniIntWrapper nativeInfoBar, 69 env, jobject obj, JniIntWrapper nativeInfoBar,
71 jstring realm, 70 jstring realm,
72 jstring account, 71 jstring account,
73 jstring args) { 72 jstring args) {
74 /* Must call RegisterNativesImpl() */
75 CHECK_CLAZZ(env, obj, 73 CHECK_CLAZZ(env, obj,
76 TestJni_clazz(env), NULL); 74 TestJni_clazz(env), NULL);
77 jmethodID method_id = 75 jmethodID method_id =
78 base::android::MethodID::LazyGet< 76 base::android::MethodID::LazyGet<
79 base::android::MethodID::TYPE_INSTANCE>( 77 base::android::MethodID::TYPE_INSTANCE>(
80 env, TestJni_clazz(env), 78 env, TestJni_clazz(env),
81 "showAutoLoginInfoBar", 79 "showAutoLoginInfoBar",
82 80
83 "(" 81 "("
84 "I" 82 "I"
85 "Ljava/lang/String;" 83 "Ljava/lang/String;"
86 "Ljava/lang/String;" 84 "Ljava/lang/String;"
87 "Ljava/lang/String;" 85 "Ljava/lang/String;"
88 ")" 86 ")"
89 "Lorg/chromium/Foo$InnerClass;", 87 "Lorg/chromium/Foo$InnerClass;",
90 &g_TestJni_showAutoLoginInfoBar); 88 &g_TestJni_showAutoLoginInfoBar);
91 89
92 jobject ret = 90 jobject ret =
93 env->CallObjectMethod(obj, 91 env->CallObjectMethod(obj,
94 method_id, as_jint(nativeInfoBar), realm, account, args); 92 method_id, as_jint(nativeInfoBar), realm, account, args);
95 jni_generator::CheckException(env); 93 jni_generator::CheckException(env);
96 return ScopedJavaLocalRef<jobject>(env, ret); 94 return ScopedJavaLocalRef<jobject>(env, ret);
97 } 95 }
98 96
99 static base::subtle::AtomicWord g_InfoBar_dismiss = 0; 97 static base::subtle::AtomicWord g_InfoBar_dismiss = 0;
100 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) { 98 static void Java_InfoBar_dismiss(JNIEnv* env, jobject obj) {
101 /* Must call RegisterNativesImpl() */
102 CHECK_CLAZZ(env, obj, 99 CHECK_CLAZZ(env, obj,
103 InfoBar_clazz(env)); 100 InfoBar_clazz(env));
104 jmethodID method_id = 101 jmethodID method_id =
105 base::android::MethodID::LazyGet< 102 base::android::MethodID::LazyGet<
106 base::android::MethodID::TYPE_INSTANCE>( 103 base::android::MethodID::TYPE_INSTANCE>(
107 env, InfoBar_clazz(env), 104 env, InfoBar_clazz(env),
108 "dismiss", 105 "dismiss",
109 106
110 "(" 107 "("
111 ")" 108 ")"
112 "V", 109 "V",
113 &g_InfoBar_dismiss); 110 &g_InfoBar_dismiss);
114 111
115 env->CallVoidMethod(obj, 112 env->CallVoidMethod(obj,
116 method_id); 113 method_id);
117 jni_generator::CheckException(env); 114 jni_generator::CheckException(env);
118 115
119 } 116 }
120 117
121 static base::subtle::AtomicWord g_TestJni_shouldShowAutoLogin = 0; 118 static base::subtle::AtomicWord g_TestJni_shouldShowAutoLogin = 0;
122 static jboolean Java_TestJni_shouldShowAutoLogin(JNIEnv* env, jobject view, 119 static jboolean Java_TestJni_shouldShowAutoLogin(JNIEnv* env, jobject view,
123 jstring realm, 120 jstring realm,
124 jstring account, 121 jstring account,
125 jstring args) { 122 jstring args) {
126 /* Must call RegisterNativesImpl() */
127 CHECK_CLAZZ(env, TestJni_clazz(env), 123 CHECK_CLAZZ(env, TestJni_clazz(env),
128 TestJni_clazz(env), false); 124 TestJni_clazz(env), false);
129 jmethodID method_id = 125 jmethodID method_id =
130 base::android::MethodID::LazyGet< 126 base::android::MethodID::LazyGet<
131 base::android::MethodID::TYPE_STATIC>( 127 base::android::MethodID::TYPE_STATIC>(
132 env, TestJni_clazz(env), 128 env, TestJni_clazz(env),
133 "shouldShowAutoLogin", 129 "shouldShowAutoLogin",
134 130
135 "(" 131 "("
136 "Landroid/view/View;" 132 "Landroid/view/View;"
137 "Ljava/lang/String;" 133 "Ljava/lang/String;"
138 "Ljava/lang/String;" 134 "Ljava/lang/String;"
139 "Ljava/lang/String;" 135 "Ljava/lang/String;"
140 ")" 136 ")"
141 "Z", 137 "Z",
142 &g_TestJni_shouldShowAutoLogin); 138 &g_TestJni_shouldShowAutoLogin);
143 139
144 jboolean ret = 140 jboolean ret =
145 env->CallStaticBooleanMethod(TestJni_clazz(env), 141 env->CallStaticBooleanMethod(TestJni_clazz(env),
146 method_id, view, realm, account, args); 142 method_id, view, realm, account, args);
147 jni_generator::CheckException(env); 143 jni_generator::CheckException(env);
148 return ret; 144 return ret;
149 } 145 }
150 146
151 static base::subtle::AtomicWord g_TestJni_openUrl = 0; 147 static base::subtle::AtomicWord g_TestJni_openUrl = 0;
152 static ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv* env, jstring 148 static ScopedJavaLocalRef<jobject> Java_TestJni_openUrl(JNIEnv* env, jstring
153 url) { 149 url) {
154 /* Must call RegisterNativesImpl() */
155 CHECK_CLAZZ(env, TestJni_clazz(env), 150 CHECK_CLAZZ(env, TestJni_clazz(env),
156 TestJni_clazz(env), NULL); 151 TestJni_clazz(env), NULL);
157 jmethodID method_id = 152 jmethodID method_id =
158 base::android::MethodID::LazyGet< 153 base::android::MethodID::LazyGet<
159 base::android::MethodID::TYPE_STATIC>( 154 base::android::MethodID::TYPE_STATIC>(
160 env, TestJni_clazz(env), 155 env, TestJni_clazz(env),
161 "openUrl", 156 "openUrl",
162 157
163 "(" 158 "("
164 "Ljava/lang/String;" 159 "Ljava/lang/String;"
165 ")" 160 ")"
166 "Ljava/io/InputStream;", 161 "Ljava/io/InputStream;",
167 &g_TestJni_openUrl); 162 &g_TestJni_openUrl);
168 163
169 jobject ret = 164 jobject ret =
170 env->CallStaticObjectMethod(TestJni_clazz(env), 165 env->CallStaticObjectMethod(TestJni_clazz(env),
171 method_id, url); 166 method_id, url);
172 jni_generator::CheckException(env); 167 jni_generator::CheckException(env);
173 return ScopedJavaLocalRef<jobject>(env, ret); 168 return ScopedJavaLocalRef<jobject>(env, ret);
174 } 169 }
175 170
176 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0; 171 static base::subtle::AtomicWord g_TestJni_activateHardwareAcceleration = 0;
177 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj, 172 static void Java_TestJni_activateHardwareAcceleration(JNIEnv* env, jobject obj,
178 jboolean activated, 173 jboolean activated,
179 JniIntWrapper iPid, 174 JniIntWrapper iPid,
180 JniIntWrapper iType, 175 JniIntWrapper iType,
181 JniIntWrapper iPrimaryID, 176 JniIntWrapper iPrimaryID,
182 JniIntWrapper iSecondaryID) { 177 JniIntWrapper iSecondaryID) {
183 /* Must call RegisterNativesImpl() */
184 CHECK_CLAZZ(env, obj, 178 CHECK_CLAZZ(env, obj,
185 TestJni_clazz(env)); 179 TestJni_clazz(env));
186 jmethodID method_id = 180 jmethodID method_id =
187 base::android::MethodID::LazyGet< 181 base::android::MethodID::LazyGet<
188 base::android::MethodID::TYPE_INSTANCE>( 182 base::android::MethodID::TYPE_INSTANCE>(
189 env, TestJni_clazz(env), 183 env, TestJni_clazz(env),
190 "activateHardwareAcceleration", 184 "activateHardwareAcceleration",
191 185
192 "(" 186 "("
193 "Z" 187 "Z"
194 "I" 188 "I"
195 "I" 189 "I"
196 "I" 190 "I"
197 "I" 191 "I"
198 ")" 192 ")"
199 "V", 193 "V",
200 &g_TestJni_activateHardwareAcceleration); 194 &g_TestJni_activateHardwareAcceleration);
201 195
202 env->CallVoidMethod(obj, 196 env->CallVoidMethod(obj,
203 method_id, activated, as_jint(iPid), as_jint(iType), 197 method_id, activated, as_jint(iPid), as_jint(iType),
204 as_jint(iPrimaryID), as_jint(iSecondaryID)); 198 as_jint(iPrimaryID), as_jint(iSecondaryID));
205 jni_generator::CheckException(env); 199 jni_generator::CheckException(env);
206 200
207 } 201 }
208 202
209 static base::subtle::AtomicWord g_TestJni_uncheckedCall = 0; 203 static base::subtle::AtomicWord g_TestJni_uncheckedCall = 0;
210 static void Java_TestJni_uncheckedCall(JNIEnv* env, jobject obj, JniIntWrapper 204 static void Java_TestJni_uncheckedCall(JNIEnv* env, jobject obj, JniIntWrapper
211 iParam) { 205 iParam) {
212 /* Must call RegisterNativesImpl() */
213 CHECK_CLAZZ(env, obj, 206 CHECK_CLAZZ(env, obj,
214 TestJni_clazz(env)); 207 TestJni_clazz(env));
215 jmethodID method_id = 208 jmethodID method_id =
216 base::android::MethodID::LazyGet< 209 base::android::MethodID::LazyGet<
217 base::android::MethodID::TYPE_INSTANCE>( 210 base::android::MethodID::TYPE_INSTANCE>(
218 env, TestJni_clazz(env), 211 env, TestJni_clazz(env),
219 "uncheckedCall", 212 "uncheckedCall",
220 213
221 "(" 214 "("
222 "I" 215 "I"
223 ")" 216 ")"
224 "V", 217 "V",
225 &g_TestJni_uncheckedCall); 218 &g_TestJni_uncheckedCall);
226 219
227 env->CallVoidMethod(obj, 220 env->CallVoidMethod(obj,
228 method_id, as_jint(iParam)); 221 method_id, as_jint(iParam));
229 222
230 } 223 }
231 224
232 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0; 225 static base::subtle::AtomicWord g_TestJni_returnByteArray = 0;
233 static ScopedJavaLocalRef<jbyteArray> Java_TestJni_returnByteArray(JNIEnv* env, 226 static ScopedJavaLocalRef<jbyteArray> Java_TestJni_returnByteArray(JNIEnv* env,
234 jobject obj) { 227 jobject obj) {
235 /* Must call RegisterNativesImpl() */
236 CHECK_CLAZZ(env, obj, 228 CHECK_CLAZZ(env, obj,
237 TestJni_clazz(env), NULL); 229 TestJni_clazz(env), NULL);
238 jmethodID method_id = 230 jmethodID method_id =
239 base::android::MethodID::LazyGet< 231 base::android::MethodID::LazyGet<
240 base::android::MethodID::TYPE_INSTANCE>( 232 base::android::MethodID::TYPE_INSTANCE>(
241 env, TestJni_clazz(env), 233 env, TestJni_clazz(env),
242 "returnByteArray", 234 "returnByteArray",
243 235
244 "(" 236 "("
245 ")" 237 ")"
246 "[B", 238 "[B",
247 &g_TestJni_returnByteArray); 239 &g_TestJni_returnByteArray);
248 240
249 jbyteArray ret = 241 jbyteArray ret =
250 static_cast<jbyteArray>(env->CallObjectMethod(obj, 242 static_cast<jbyteArray>(env->CallObjectMethod(obj,
251 method_id)); 243 method_id));
252 jni_generator::CheckException(env); 244 jni_generator::CheckException(env);
253 return ScopedJavaLocalRef<jbyteArray>(env, ret); 245 return ScopedJavaLocalRef<jbyteArray>(env, ret);
254 } 246 }
255 247
256 static base::subtle::AtomicWord g_TestJni_returnBooleanArray = 0; 248 static base::subtle::AtomicWord g_TestJni_returnBooleanArray = 0;
257 static ScopedJavaLocalRef<jbooleanArray> Java_TestJni_returnBooleanArray(JNIEnv* 249 static ScopedJavaLocalRef<jbooleanArray> Java_TestJni_returnBooleanArray(JNIEnv*
258 env, jobject obj) { 250 env, jobject obj) {
259 /* Must call RegisterNativesImpl() */
260 CHECK_CLAZZ(env, obj, 251 CHECK_CLAZZ(env, obj,
261 TestJni_clazz(env), NULL); 252 TestJni_clazz(env), NULL);
262 jmethodID method_id = 253 jmethodID method_id =
263 base::android::MethodID::LazyGet< 254 base::android::MethodID::LazyGet<
264 base::android::MethodID::TYPE_INSTANCE>( 255 base::android::MethodID::TYPE_INSTANCE>(
265 env, TestJni_clazz(env), 256 env, TestJni_clazz(env),
266 "returnBooleanArray", 257 "returnBooleanArray",
267 258
268 "(" 259 "("
269 ")" 260 ")"
270 "[Z", 261 "[Z",
271 &g_TestJni_returnBooleanArray); 262 &g_TestJni_returnBooleanArray);
272 263
273 jbooleanArray ret = 264 jbooleanArray ret =
274 static_cast<jbooleanArray>(env->CallObjectMethod(obj, 265 static_cast<jbooleanArray>(env->CallObjectMethod(obj,
275 method_id)); 266 method_id));
276 jni_generator::CheckException(env); 267 jni_generator::CheckException(env);
277 return ScopedJavaLocalRef<jbooleanArray>(env, ret); 268 return ScopedJavaLocalRef<jbooleanArray>(env, ret);
278 } 269 }
279 270
280 static base::subtle::AtomicWord g_TestJni_returnCharArray = 0; 271 static base::subtle::AtomicWord g_TestJni_returnCharArray = 0;
281 static ScopedJavaLocalRef<jcharArray> Java_TestJni_returnCharArray(JNIEnv* env, 272 static ScopedJavaLocalRef<jcharArray> Java_TestJni_returnCharArray(JNIEnv* env,
282 jobject obj) { 273 jobject obj) {
283 /* Must call RegisterNativesImpl() */
284 CHECK_CLAZZ(env, obj, 274 CHECK_CLAZZ(env, obj,
285 TestJni_clazz(env), NULL); 275 TestJni_clazz(env), NULL);
286 jmethodID method_id = 276 jmethodID method_id =
287 base::android::MethodID::LazyGet< 277 base::android::MethodID::LazyGet<
288 base::android::MethodID::TYPE_INSTANCE>( 278 base::android::MethodID::TYPE_INSTANCE>(
289 env, TestJni_clazz(env), 279 env, TestJni_clazz(env),
290 "returnCharArray", 280 "returnCharArray",
291 281
292 "(" 282 "("
293 ")" 283 ")"
294 "[C", 284 "[C",
295 &g_TestJni_returnCharArray); 285 &g_TestJni_returnCharArray);
296 286
297 jcharArray ret = 287 jcharArray ret =
298 static_cast<jcharArray>(env->CallObjectMethod(obj, 288 static_cast<jcharArray>(env->CallObjectMethod(obj,
299 method_id)); 289 method_id));
300 jni_generator::CheckException(env); 290 jni_generator::CheckException(env);
301 return ScopedJavaLocalRef<jcharArray>(env, ret); 291 return ScopedJavaLocalRef<jcharArray>(env, ret);
302 } 292 }
303 293
304 static base::subtle::AtomicWord g_TestJni_returnShortArray = 0; 294 static base::subtle::AtomicWord g_TestJni_returnShortArray = 0;
305 static ScopedJavaLocalRef<jshortArray> Java_TestJni_returnShortArray(JNIEnv* 295 static ScopedJavaLocalRef<jshortArray> Java_TestJni_returnShortArray(JNIEnv*
306 env, jobject obj) { 296 env, jobject obj) {
307 /* Must call RegisterNativesImpl() */
308 CHECK_CLAZZ(env, obj, 297 CHECK_CLAZZ(env, obj,
309 TestJni_clazz(env), NULL); 298 TestJni_clazz(env), NULL);
310 jmethodID method_id = 299 jmethodID method_id =
311 base::android::MethodID::LazyGet< 300 base::android::MethodID::LazyGet<
312 base::android::MethodID::TYPE_INSTANCE>( 301 base::android::MethodID::TYPE_INSTANCE>(
313 env, TestJni_clazz(env), 302 env, TestJni_clazz(env),
314 "returnShortArray", 303 "returnShortArray",
315 304
316 "(" 305 "("
317 ")" 306 ")"
318 "[S", 307 "[S",
319 &g_TestJni_returnShortArray); 308 &g_TestJni_returnShortArray);
320 309
321 jshortArray ret = 310 jshortArray ret =
322 static_cast<jshortArray>(env->CallObjectMethod(obj, 311 static_cast<jshortArray>(env->CallObjectMethod(obj,
323 method_id)); 312 method_id));
324 jni_generator::CheckException(env); 313 jni_generator::CheckException(env);
325 return ScopedJavaLocalRef<jshortArray>(env, ret); 314 return ScopedJavaLocalRef<jshortArray>(env, ret);
326 } 315 }
327 316
328 static base::subtle::AtomicWord g_TestJni_returnIntArray = 0; 317 static base::subtle::AtomicWord g_TestJni_returnIntArray = 0;
329 static ScopedJavaLocalRef<jintArray> Java_TestJni_returnIntArray(JNIEnv* env, 318 static ScopedJavaLocalRef<jintArray> Java_TestJni_returnIntArray(JNIEnv* env,
330 jobject obj) { 319 jobject obj) {
331 /* Must call RegisterNativesImpl() */
332 CHECK_CLAZZ(env, obj, 320 CHECK_CLAZZ(env, obj,
333 TestJni_clazz(env), NULL); 321 TestJni_clazz(env), NULL);
334 jmethodID method_id = 322 jmethodID method_id =
335 base::android::MethodID::LazyGet< 323 base::android::MethodID::LazyGet<
336 base::android::MethodID::TYPE_INSTANCE>( 324 base::android::MethodID::TYPE_INSTANCE>(
337 env, TestJni_clazz(env), 325 env, TestJni_clazz(env),
338 "returnIntArray", 326 "returnIntArray",
339 327
340 "(" 328 "("
341 ")" 329 ")"
342 "[I", 330 "[I",
343 &g_TestJni_returnIntArray); 331 &g_TestJni_returnIntArray);
344 332
345 jintArray ret = 333 jintArray ret =
346 static_cast<jintArray>(env->CallObjectMethod(obj, 334 static_cast<jintArray>(env->CallObjectMethod(obj,
347 method_id)); 335 method_id));
348 jni_generator::CheckException(env); 336 jni_generator::CheckException(env);
349 return ScopedJavaLocalRef<jintArray>(env, ret); 337 return ScopedJavaLocalRef<jintArray>(env, ret);
350 } 338 }
351 339
352 static base::subtle::AtomicWord g_TestJni_returnLongArray = 0; 340 static base::subtle::AtomicWord g_TestJni_returnLongArray = 0;
353 static ScopedJavaLocalRef<jlongArray> Java_TestJni_returnLongArray(JNIEnv* env, 341 static ScopedJavaLocalRef<jlongArray> Java_TestJni_returnLongArray(JNIEnv* env,
354 jobject obj) { 342 jobject obj) {
355 /* Must call RegisterNativesImpl() */
356 CHECK_CLAZZ(env, obj, 343 CHECK_CLAZZ(env, obj,
357 TestJni_clazz(env), NULL); 344 TestJni_clazz(env), NULL);
358 jmethodID method_id = 345 jmethodID method_id =
359 base::android::MethodID::LazyGet< 346 base::android::MethodID::LazyGet<
360 base::android::MethodID::TYPE_INSTANCE>( 347 base::android::MethodID::TYPE_INSTANCE>(
361 env, TestJni_clazz(env), 348 env, TestJni_clazz(env),
362 "returnLongArray", 349 "returnLongArray",
363 350
364 "(" 351 "("
365 ")" 352 ")"
366 "[J", 353 "[J",
367 &g_TestJni_returnLongArray); 354 &g_TestJni_returnLongArray);
368 355
369 jlongArray ret = 356 jlongArray ret =
370 static_cast<jlongArray>(env->CallObjectMethod(obj, 357 static_cast<jlongArray>(env->CallObjectMethod(obj,
371 method_id)); 358 method_id));
372 jni_generator::CheckException(env); 359 jni_generator::CheckException(env);
373 return ScopedJavaLocalRef<jlongArray>(env, ret); 360 return ScopedJavaLocalRef<jlongArray>(env, ret);
374 } 361 }
375 362
376 static base::subtle::AtomicWord g_TestJni_returnDoubleArray = 0; 363 static base::subtle::AtomicWord g_TestJni_returnDoubleArray = 0;
377 static ScopedJavaLocalRef<jdoubleArray> Java_TestJni_returnDoubleArray(JNIEnv* 364 static ScopedJavaLocalRef<jdoubleArray> Java_TestJni_returnDoubleArray(JNIEnv*
378 env, jobject obj) { 365 env, jobject obj) {
379 /* Must call RegisterNativesImpl() */
380 CHECK_CLAZZ(env, obj, 366 CHECK_CLAZZ(env, obj,
381 TestJni_clazz(env), NULL); 367 TestJni_clazz(env), NULL);
382 jmethodID method_id = 368 jmethodID method_id =
383 base::android::MethodID::LazyGet< 369 base::android::MethodID::LazyGet<
384 base::android::MethodID::TYPE_INSTANCE>( 370 base::android::MethodID::TYPE_INSTANCE>(
385 env, TestJni_clazz(env), 371 env, TestJni_clazz(env),
386 "returnDoubleArray", 372 "returnDoubleArray",
387 373
388 "(" 374 "("
389 ")" 375 ")"
390 "[D", 376 "[D",
391 &g_TestJni_returnDoubleArray); 377 &g_TestJni_returnDoubleArray);
392 378
393 jdoubleArray ret = 379 jdoubleArray ret =
394 static_cast<jdoubleArray>(env->CallObjectMethod(obj, 380 static_cast<jdoubleArray>(env->CallObjectMethod(obj,
395 method_id)); 381 method_id));
396 jni_generator::CheckException(env); 382 jni_generator::CheckException(env);
397 return ScopedJavaLocalRef<jdoubleArray>(env, ret); 383 return ScopedJavaLocalRef<jdoubleArray>(env, ret);
398 } 384 }
399 385
400 static base::subtle::AtomicWord g_TestJni_returnObjectArray = 0; 386 static base::subtle::AtomicWord g_TestJni_returnObjectArray = 0;
401 static ScopedJavaLocalRef<jobjectArray> Java_TestJni_returnObjectArray(JNIEnv* 387 static ScopedJavaLocalRef<jobjectArray> Java_TestJni_returnObjectArray(JNIEnv*
402 env, jobject obj) { 388 env, jobject obj) {
403 /* Must call RegisterNativesImpl() */
404 CHECK_CLAZZ(env, obj, 389 CHECK_CLAZZ(env, obj,
405 TestJni_clazz(env), NULL); 390 TestJni_clazz(env), NULL);
406 jmethodID method_id = 391 jmethodID method_id =
407 base::android::MethodID::LazyGet< 392 base::android::MethodID::LazyGet<
408 base::android::MethodID::TYPE_INSTANCE>( 393 base::android::MethodID::TYPE_INSTANCE>(
409 env, TestJni_clazz(env), 394 env, TestJni_clazz(env),
410 "returnObjectArray", 395 "returnObjectArray",
411 396
412 "(" 397 "("
413 ")" 398 ")"
414 "[Ljava/lang/Object;", 399 "[Ljava/lang/Object;",
415 &g_TestJni_returnObjectArray); 400 &g_TestJni_returnObjectArray);
416 401
417 jobjectArray ret = 402 jobjectArray ret =
418 static_cast<jobjectArray>(env->CallObjectMethod(obj, 403 static_cast<jobjectArray>(env->CallObjectMethod(obj,
419 method_id)); 404 method_id));
420 jni_generator::CheckException(env); 405 jni_generator::CheckException(env);
421 return ScopedJavaLocalRef<jobjectArray>(env, ret); 406 return ScopedJavaLocalRef<jobjectArray>(env, ret);
422 } 407 }
423 408
424 static base::subtle::AtomicWord g_TestJni_returnArrayOfByteArray = 0; 409 static base::subtle::AtomicWord g_TestJni_returnArrayOfByteArray = 0;
425 static ScopedJavaLocalRef<jobjectArray> 410 static ScopedJavaLocalRef<jobjectArray>
426 Java_TestJni_returnArrayOfByteArray(JNIEnv* env, jobject obj) { 411 Java_TestJni_returnArrayOfByteArray(JNIEnv* env, jobject obj) {
427 /* Must call RegisterNativesImpl() */
428 CHECK_CLAZZ(env, obj, 412 CHECK_CLAZZ(env, obj,
429 TestJni_clazz(env), NULL); 413 TestJni_clazz(env), NULL);
430 jmethodID method_id = 414 jmethodID method_id =
431 base::android::MethodID::LazyGet< 415 base::android::MethodID::LazyGet<
432 base::android::MethodID::TYPE_INSTANCE>( 416 base::android::MethodID::TYPE_INSTANCE>(
433 env, TestJni_clazz(env), 417 env, TestJni_clazz(env),
434 "returnArrayOfByteArray", 418 "returnArrayOfByteArray",
435 419
436 "(" 420 "("
437 ")" 421 ")"
438 "[[B", 422 "[[B",
439 &g_TestJni_returnArrayOfByteArray); 423 &g_TestJni_returnArrayOfByteArray);
440 424
441 jobjectArray ret = 425 jobjectArray ret =
442 static_cast<jobjectArray>(env->CallObjectMethod(obj, 426 static_cast<jobjectArray>(env->CallObjectMethod(obj,
443 method_id)); 427 method_id));
444 jni_generator::CheckException(env); 428 jni_generator::CheckException(env);
445 return ScopedJavaLocalRef<jobjectArray>(env, ret); 429 return ScopedJavaLocalRef<jobjectArray>(env, ret);
446 } 430 }
447 431
448 static base::subtle::AtomicWord g_TestJni_getCompressFormat = 0; 432 static base::subtle::AtomicWord g_TestJni_getCompressFormat = 0;
449 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormat(JNIEnv* env, 433 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormat(JNIEnv* env,
450 jobject obj) { 434 jobject obj) {
451 /* Must call RegisterNativesImpl() */
452 CHECK_CLAZZ(env, obj, 435 CHECK_CLAZZ(env, obj,
453 TestJni_clazz(env), NULL); 436 TestJni_clazz(env), NULL);
454 jmethodID method_id = 437 jmethodID method_id =
455 base::android::MethodID::LazyGet< 438 base::android::MethodID::LazyGet<
456 base::android::MethodID::TYPE_INSTANCE>( 439 base::android::MethodID::TYPE_INSTANCE>(
457 env, TestJni_clazz(env), 440 env, TestJni_clazz(env),
458 "getCompressFormat", 441 "getCompressFormat",
459 442
460 "(" 443 "("
461 ")" 444 ")"
462 "Landroid/graphics/Bitmap$CompressFormat;", 445 "Landroid/graphics/Bitmap$CompressFormat;",
463 &g_TestJni_getCompressFormat); 446 &g_TestJni_getCompressFormat);
464 447
465 jobject ret = 448 jobject ret =
466 env->CallObjectMethod(obj, 449 env->CallObjectMethod(obj,
467 method_id); 450 method_id);
468 jni_generator::CheckException(env); 451 jni_generator::CheckException(env);
469 return ScopedJavaLocalRef<jobject>(env, ret); 452 return ScopedJavaLocalRef<jobject>(env, ret);
470 } 453 }
471 454
472 static base::subtle::AtomicWord g_TestJni_getCompressFormatList = 0; 455 static base::subtle::AtomicWord g_TestJni_getCompressFormatList = 0;
473 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormatList(JNIEnv* 456 static ScopedJavaLocalRef<jobject> Java_TestJni_getCompressFormatList(JNIEnv*
474 env, jobject obj) { 457 env, jobject obj) {
475 /* Must call RegisterNativesImpl() */
476 CHECK_CLAZZ(env, obj, 458 CHECK_CLAZZ(env, obj,
477 TestJni_clazz(env), NULL); 459 TestJni_clazz(env), NULL);
478 jmethodID method_id = 460 jmethodID method_id =
479 base::android::MethodID::LazyGet< 461 base::android::MethodID::LazyGet<
480 base::android::MethodID::TYPE_INSTANCE>( 462 base::android::MethodID::TYPE_INSTANCE>(
481 env, TestJni_clazz(env), 463 env, TestJni_clazz(env),
482 "getCompressFormatList", 464 "getCompressFormatList",
483 465
484 "(" 466 "("
485 ")" 467 ")"
486 "Ljava/util/List;", 468 "Ljava/util/List;",
487 &g_TestJni_getCompressFormatList); 469 &g_TestJni_getCompressFormatList);
488 470
489 jobject ret = 471 jobject ret =
490 env->CallObjectMethod(obj, 472 env->CallObjectMethod(obj,
491 method_id); 473 method_id);
492 jni_generator::CheckException(env); 474 jni_generator::CheckException(env);
493 return ScopedJavaLocalRef<jobject>(env, ret); 475 return ScopedJavaLocalRef<jobject>(env, ret);
494 } 476 }
495 477
496 // Step 3: RegisterNatives. 478 // Step 3: RegisterNatives.
497 479
480 static bool RegisterNativesImpl(JNIEnv* env) __attribute__((unused));
498 static bool RegisterNativesImpl(JNIEnv* env) { 481 static bool RegisterNativesImpl(JNIEnv* env) {
499 if (base::android::IsManualJniRegistrationDisabled()) return true; 482 if (base::android::IsManualJniRegistrationDisabled()) return true;
500 483
501 return true; 484 return true;
502 } 485 }
503 486
504 #endif // org_chromium_TestJni_JNI 487 #endif // org_chromium_TestJni_JNI
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698