| 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> |
| 11 | 11 |
| 12 #include "base/android/scoped_java_ref.h" | 12 #include "base/android/scoped_java_ref.h" |
| 13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/string16.h" | 14 #include "base/string16.h" |
| 15 | 15 |
| 16 namespace base { | 16 namespace base { |
| 17 namespace android { | 17 namespace android { |
| 18 | 18 |
| 19 // Returns a new Java byte array converted from the given bytes array. | 19 // Returns a new Java byte array converted from the given bytes array. |
| 20 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray( | 20 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray( |
| 21 JNIEnv* env, const uint8* bytes, size_t len); | 21 JNIEnv* env, const uint8* bytes, size_t len); |
| 22 | 22 |
| 23 // Returns a new Java long array converted from the given int64 array. |
| 24 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( |
| 25 JNIEnv* env, const int64* longs, size_t len); |
| 26 |
| 27 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( |
| 28 JNIEnv* env, const std::vector<int64>& longs); |
| 29 |
| 23 // Returns a array of Java byte array converted from |v|. | 30 // Returns a array of Java byte array converted from |v|. |
| 24 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( | 31 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( |
| 25 JNIEnv* env, const std::vector<std::string>& v); | 32 JNIEnv* env, const std::vector<std::string>& v); |
| 26 | 33 |
| 27 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 34 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 28 JNIEnv* env, const std::vector<std::string>& v); | 35 JNIEnv* env, const std::vector<std::string>& v); |
| 29 | 36 |
| 30 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 37 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 31 JNIEnv* env, const std::vector<string16>& v); | 38 JNIEnv* env, const std::vector<string16>& v); |
| 32 | 39 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // conversion is performed. | 71 // conversion is performed. |
| 65 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( | 72 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( |
| 66 JNIEnv* env, | 73 JNIEnv* env, |
| 67 jobjectArray array, | 74 jobjectArray array, |
| 68 std::vector<std::string>* out); | 75 std::vector<std::string>* out); |
| 69 | 76 |
| 70 } // namespace android | 77 } // namespace android |
| 71 } // namespace base | 78 } // namespace base |
| 72 | 79 |
| 73 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 80 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
| OLD | NEW |