| 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 #ifndef BASE_ANDROID_JNI_ARRAY_H_ | 5 #ifndef BASE_ANDROID_JNI_ARRAY_H_ |
| 6 #define BASE_ANDROID_JNI_ARRAY_H_ | 6 #define BASE_ANDROID_JNI_ARRAY_H_ |
| 7 | 7 |
| 8 #include <jni.h> | 8 #include <jni.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 JNIEnv* env, const std::vector<std::string>& v); | 25 JNIEnv* env, const std::vector<std::string>& v); |
| 26 | 26 |
| 27 ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 27 ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 28 JNIEnv* env, const std::vector<std::string>& v); | 28 JNIEnv* env, const std::vector<std::string>& v); |
| 29 | 29 |
| 30 ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 30 ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 31 JNIEnv* env, const std::vector<string16>& v); | 31 JNIEnv* env, const std::vector<string16>& v); |
| 32 | 32 |
| 33 // Converts a Java string array to a native array. | 33 // Converts a Java string array to a native array. |
| 34 void AppendJavaStringArrayToStringVector(JNIEnv* env, | 34 void AppendJavaStringArrayToStringVector(JNIEnv* env, |
| 35 const JavaRef<jobjectArray>& array, | 35 jobjectArray array, |
| 36 std::vector<string16>* out); | 36 std::vector<string16>* out); |
| 37 | 37 |
| 38 // Appends the Java bytes in |bytes_array| onto the end of |out|. | 38 // Appends the Java bytes in |bytes_array| onto the end of |out|. |
| 39 void AppendJavaByteArrayToByteVector(JNIEnv* env, | 39 void AppendJavaByteArrayToByteVector(JNIEnv* env, |
| 40 jbyteArray byte_array, | 40 jbyteArray byte_array, |
| 41 std::vector<uint8>* out); | 41 std::vector<uint8>* out); |
| 42 | 42 |
| 43 // Replaces the content of |out| with the Java bytes in |bytes_array|. | 43 // Replaces the content of |out| with the Java bytes in |bytes_array|. |
| 44 void JavaByteArrayToByteVector(JNIEnv* env, | 44 void JavaByteArrayToByteVector(JNIEnv* env, |
| 45 jbyteArray byte_array, | 45 jbyteArray byte_array, |
| 46 std::vector<uint8>* out); | 46 std::vector<uint8>* out); |
| 47 | 47 |
| 48 } // namespace android | 48 } // namespace android |
| 49 } // namespace base | 49 } // namespace base |
| 50 | 50 |
| 51 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 51 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
| OLD | NEW |