OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 // java/io/InputStream | 8 // java/io/InputStream |
9 | 9 |
10 #ifndef java_io_InputStream_JNI | 10 #ifndef java_io_InputStream_JNI |
11 #define java_io_InputStream_JNI | 11 #define java_io_InputStream_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 kInputStreamClassPath[] = "java/io/InputStream"; | 21 const char kInputStreamClassPath[] = "java/io/InputStream"; |
20 // Leaking this jclass as we cannot use LazyInstance from some threads. | 22 // Leaking this jclass as we cannot use LazyInstance from some threads. |
21 jclass g_InputStream_clazz = NULL; | 23 jclass g_InputStream_clazz = NULL; |
22 | 24 |
23 } // namespace | 25 } // namespace |
24 | 26 |
25 namespace JNI_InputStream { | 27 namespace JNI_InputStream { |
26 | 28 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 "()V", | 65 "()V", |
64 &g_InputStream_close); | 66 &g_InputStream_close); |
65 | 67 |
66 env->CallVoidMethod(obj, | 68 env->CallVoidMethod(obj, |
67 method_id); | 69 method_id); |
68 jni_generator::CheckException(env); | 70 jni_generator::CheckException(env); |
69 | 71 |
70 } | 72 } |
71 | 73 |
72 static base::subtle::AtomicWord g_InputStream_mark = 0; | 74 static base::subtle::AtomicWord g_InputStream_mark = 0; |
73 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jint p0) | 75 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jni_int_wrapper p0) |
74 __attribute__ ((unused)); | 76 __attribute__ ((unused)); |
75 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jint p0) { | 77 static void Java_InputStream_mark(JNIEnv* env, jobject obj, jni_int_wrapper p0) |
| 78 { |
76 /* Must call RegisterNativesImpl() */ | 79 /* Must call RegisterNativesImpl() */ |
77 CHECK_CLAZZ(env, obj, | 80 CHECK_CLAZZ(env, obj, |
78 g_InputStream_clazz); | 81 g_InputStream_clazz); |
79 jmethodID method_id = | 82 jmethodID method_id = |
80 base::android::MethodID::LazyGet< | 83 base::android::MethodID::LazyGet< |
81 base::android::MethodID::TYPE_INSTANCE>( | 84 base::android::MethodID::TYPE_INSTANCE>( |
82 env, g_InputStream_clazz, | 85 env, g_InputStream_clazz, |
83 "mark", | 86 "mark", |
84 "(I)V", | 87 "(I)V", |
85 &g_InputStream_mark); | 88 &g_InputStream_mark); |
86 | 89 |
87 env->CallVoidMethod(obj, | 90 env->CallVoidMethod(obj, |
88 method_id, p0); | 91 method_id, p0.asJint()); |
89 jni_generator::CheckException(env); | 92 jni_generator::CheckException(env); |
90 | 93 |
91 } | 94 } |
92 | 95 |
93 static base::subtle::AtomicWord g_InputStream_markSupported = 0; | 96 static base::subtle::AtomicWord g_InputStream_markSupported = 0; |
94 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) | 97 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) |
95 __attribute__ ((unused)); | 98 __attribute__ ((unused)); |
96 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) { | 99 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) { |
97 /* Must call RegisterNativesImpl() */ | 100 /* Must call RegisterNativesImpl() */ |
98 CHECK_CLAZZ(env, obj, | 101 CHECK_CLAZZ(env, obj, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 jint ret = | 155 jint ret = |
153 env->CallIntMethod(obj, | 156 env->CallIntMethod(obj, |
154 method_id, p0); | 157 method_id, p0); |
155 jni_generator::CheckException(env); | 158 jni_generator::CheckException(env); |
156 return ret; | 159 return ret; |
157 } | 160 } |
158 | 161 |
159 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0; | 162 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0; |
160 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray | 163 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray |
161 p0, | 164 p0, |
162 jint p1, | 165 jni_int_wrapper p1, |
163 jint p2) __attribute__ ((unused)); | 166 jni_int_wrapper p2) __attribute__ ((unused)); |
164 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray | 167 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray |
165 p0, | 168 p0, |
166 jint p1, | 169 jni_int_wrapper p1, |
167 jint p2) { | 170 jni_int_wrapper p2) { |
168 /* Must call RegisterNativesImpl() */ | 171 /* Must call RegisterNativesImpl() */ |
169 CHECK_CLAZZ(env, obj, | 172 CHECK_CLAZZ(env, obj, |
170 g_InputStream_clazz, 0); | 173 g_InputStream_clazz, 0); |
171 jmethodID method_id = | 174 jmethodID method_id = |
172 base::android::MethodID::LazyGet< | 175 base::android::MethodID::LazyGet< |
173 base::android::MethodID::TYPE_INSTANCE>( | 176 base::android::MethodID::TYPE_INSTANCE>( |
174 env, g_InputStream_clazz, | 177 env, g_InputStream_clazz, |
175 "read", | 178 "read", |
176 "([BII)I", | 179 "([BII)I", |
177 &g_InputStream_readI_AB_I_I); | 180 &g_InputStream_readI_AB_I_I); |
178 | 181 |
179 jint ret = | 182 jint ret = |
180 env->CallIntMethod(obj, | 183 env->CallIntMethod(obj, |
181 method_id, p0, p1, p2); | 184 method_id, p0, p1.asJint(), p2.asJint()); |
182 jni_generator::CheckException(env); | 185 jni_generator::CheckException(env); |
183 return ret; | 186 return ret; |
184 } | 187 } |
185 | 188 |
186 static base::subtle::AtomicWord g_InputStream_reset = 0; | 189 static base::subtle::AtomicWord g_InputStream_reset = 0; |
187 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__ | 190 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__ |
188 ((unused)); | 191 ((unused)); |
189 static void Java_InputStream_reset(JNIEnv* env, jobject obj) { | 192 static void Java_InputStream_reset(JNIEnv* env, jobject obj) { |
190 /* Must call RegisterNativesImpl() */ | 193 /* Must call RegisterNativesImpl() */ |
191 CHECK_CLAZZ(env, obj, | 194 CHECK_CLAZZ(env, obj, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 static bool RegisterNativesImpl(JNIEnv* env) { | 257 static bool RegisterNativesImpl(JNIEnv* env) { |
255 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 258 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
256 base::android::GetClass(env, kInputStreamClassPath).obj())); | 259 base::android::GetClass(env, kInputStreamClassPath).obj())); |
257 | 260 |
258 return true; | 261 return true; |
259 } | 262 } |
260 | 263 |
261 } // namespace JNI_InputStream | 264 } // namespace JNI_InputStream |
262 | 265 |
263 #endif // java_io_InputStream_JNI | 266 #endif // java_io_InputStream_JNI |
OLD | NEW |