OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file is autogenerated by | 5 // This file is autogenerated by |
6 // base/android/jni_generator/jni_generator.py | 6 // base/android/jni_generator/jni_generator.py |
7 // For | 7 // For |
8 // 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, JniIntWrapper 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, JniIntWrapper p0) { |
76 /* Must call RegisterNativesImpl() */ | 78 /* Must call RegisterNativesImpl() */ |
77 CHECK_CLAZZ(env, obj, | 79 CHECK_CLAZZ(env, obj, |
78 g_InputStream_clazz); | 80 g_InputStream_clazz); |
79 jmethodID method_id = | 81 jmethodID method_id = |
80 base::android::MethodID::LazyGet< | 82 base::android::MethodID::LazyGet< |
81 base::android::MethodID::TYPE_INSTANCE>( | 83 base::android::MethodID::TYPE_INSTANCE>( |
82 env, g_InputStream_clazz, | 84 env, g_InputStream_clazz, |
83 "mark", | 85 "mark", |
84 "(I)V", | 86 "(I)V", |
85 &g_InputStream_mark); | 87 &g_InputStream_mark); |
86 | 88 |
87 env->CallVoidMethod(obj, | 89 env->CallVoidMethod(obj, |
88 method_id, p0); | 90 method_id, as_jint(p0)); |
89 jni_generator::CheckException(env); | 91 jni_generator::CheckException(env); |
90 | 92 |
91 } | 93 } |
92 | 94 |
93 static base::subtle::AtomicWord g_InputStream_markSupported = 0; | 95 static base::subtle::AtomicWord g_InputStream_markSupported = 0; |
94 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) | 96 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) |
95 __attribute__ ((unused)); | 97 __attribute__ ((unused)); |
96 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) { | 98 static jboolean Java_InputStream_markSupported(JNIEnv* env, jobject obj) { |
97 /* Must call RegisterNativesImpl() */ | 99 /* Must call RegisterNativesImpl() */ |
98 CHECK_CLAZZ(env, obj, | 100 CHECK_CLAZZ(env, obj, |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 jint ret = | 154 jint ret = |
153 env->CallIntMethod(obj, | 155 env->CallIntMethod(obj, |
154 method_id, p0); | 156 method_id, p0); |
155 jni_generator::CheckException(env); | 157 jni_generator::CheckException(env); |
156 return ret; | 158 return ret; |
157 } | 159 } |
158 | 160 |
159 static base::subtle::AtomicWord g_InputStream_readI_AB_I_I = 0; | 161 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 | 162 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray |
161 p0, | 163 p0, |
162 jint p1, | 164 JniIntWrapper p1, |
163 jint p2) __attribute__ ((unused)); | 165 JniIntWrapper p2) __attribute__ ((unused)); |
164 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray | 166 static jint Java_InputStream_readI_AB_I_I(JNIEnv* env, jobject obj, jbyteArray |
165 p0, | 167 p0, |
166 jint p1, | 168 JniIntWrapper p1, |
167 jint p2) { | 169 JniIntWrapper p2) { |
168 /* Must call RegisterNativesImpl() */ | 170 /* Must call RegisterNativesImpl() */ |
169 CHECK_CLAZZ(env, obj, | 171 CHECK_CLAZZ(env, obj, |
170 g_InputStream_clazz, 0); | 172 g_InputStream_clazz, 0); |
171 jmethodID method_id = | 173 jmethodID method_id = |
172 base::android::MethodID::LazyGet< | 174 base::android::MethodID::LazyGet< |
173 base::android::MethodID::TYPE_INSTANCE>( | 175 base::android::MethodID::TYPE_INSTANCE>( |
174 env, g_InputStream_clazz, | 176 env, g_InputStream_clazz, |
175 "read", | 177 "read", |
176 "([BII)I", | 178 "([BII)I", |
177 &g_InputStream_readI_AB_I_I); | 179 &g_InputStream_readI_AB_I_I); |
178 | 180 |
179 jint ret = | 181 jint ret = |
180 env->CallIntMethod(obj, | 182 env->CallIntMethod(obj, |
181 method_id, p0, p1, p2); | 183 method_id, p0, as_jint(p1), as_jint(p2)); |
182 jni_generator::CheckException(env); | 184 jni_generator::CheckException(env); |
183 return ret; | 185 return ret; |
184 } | 186 } |
185 | 187 |
186 static base::subtle::AtomicWord g_InputStream_reset = 0; | 188 static base::subtle::AtomicWord g_InputStream_reset = 0; |
187 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__ | 189 static void Java_InputStream_reset(JNIEnv* env, jobject obj) __attribute__ |
188 ((unused)); | 190 ((unused)); |
189 static void Java_InputStream_reset(JNIEnv* env, jobject obj) { | 191 static void Java_InputStream_reset(JNIEnv* env, jobject obj) { |
190 /* Must call RegisterNativesImpl() */ | 192 /* Must call RegisterNativesImpl() */ |
191 CHECK_CLAZZ(env, obj, | 193 CHECK_CLAZZ(env, obj, |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 static bool RegisterNativesImpl(JNIEnv* env) { | 256 static bool RegisterNativesImpl(JNIEnv* env) { |
255 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( | 257 g_InputStream_clazz = reinterpret_cast<jclass>(env->NewGlobalRef( |
256 base::android::GetClass(env, kInputStreamClassPath).obj())); | 258 base::android::GetClass(env, kInputStreamClassPath).obj())); |
257 | 259 |
258 return true; | 260 return true; |
259 } | 261 } |
260 | 262 |
261 } // namespace JNI_InputStream | 263 } // namespace JNI_InputStream |
262 | 264 |
263 #endif // java_io_InputStream_JNI | 265 #endif // java_io_InputStream_JNI |
OLD | NEW |