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