| 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 16 matching lines...) Expand all Loading... |
| 27 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( | 27 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( |
| 28 JNIEnv* env, const std::vector<int>& ints); | 28 JNIEnv* env, const std::vector<int>& ints); |
| 29 | 29 |
| 30 // Returns a new Java long array converted from the given int64 array. | 30 // Returns a new Java long array converted from the given int64 array. |
| 31 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( | 31 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( |
| 32 JNIEnv* env, const int64* longs, size_t len); | 32 JNIEnv* env, const int64* longs, size_t len); |
| 33 | 33 |
| 34 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( | 34 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( |
| 35 JNIEnv* env, const std::vector<int64>& longs); | 35 JNIEnv* env, const std::vector<int64>& longs); |
| 36 | 36 |
| 37 // Returns a new Java float array converted from the given int array. |
| 38 BASE_EXPORT ScopedJavaLocalRef<jfloatArray> ToJavaFloatArray( |
| 39 JNIEnv* env, const float* floats, size_t len); |
| 40 |
| 37 // Returns a array of Java byte array converted from |v|. | 41 // Returns a array of Java byte array converted from |v|. |
| 38 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( | 42 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( |
| 39 JNIEnv* env, const std::vector<std::string>& v); | 43 JNIEnv* env, const std::vector<std::string>& v); |
| 40 | 44 |
| 41 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 45 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 42 JNIEnv* env, const std::vector<std::string>& v); | 46 JNIEnv* env, const std::vector<std::string>& v); |
| 43 | 47 |
| 44 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( | 48 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfStrings( |
| 45 JNIEnv* env, const std::vector<string16>& v); | 49 JNIEnv* env, const std::vector<string16>& v); |
| 46 | 50 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 // conversion is performed. | 94 // conversion is performed. |
| 91 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( | 95 BASE_EXPORT void JavaArrayOfByteArrayToStringVector( |
| 92 JNIEnv* env, | 96 JNIEnv* env, |
| 93 jobjectArray array, | 97 jobjectArray array, |
| 94 std::vector<std::string>* out); | 98 std::vector<std::string>* out); |
| 95 | 99 |
| 96 } // namespace android | 100 } // namespace android |
| 97 } // namespace base | 101 } // namespace base |
| 98 | 102 |
| 99 #endif // BASE_ANDROID_JNI_ARRAY_H_ | 103 #endif // BASE_ANDROID_JNI_ARRAY_H_ |
| OLD | NEW |