Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(85)

Side by Side Diff: base/android/jni_array.h

Issue 1543293003: Switch to standard integer types in base/android/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « base/android/jni_android.cc ('k') | base/android/jni_array.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stddef.h>
9 #include <stdint.h> 10 #include <stdint.h>
10 #include <string> 11 #include <string>
11 #include <vector> 12 #include <vector>
12 13
13 #include "base/android/scoped_java_ref.h" 14 #include "base/android/scoped_java_ref.h"
14 #include "base/strings/string16.h" 15 #include "base/strings/string16.h"
15 16
16 namespace base { 17 namespace base {
17 namespace android { 18 namespace android {
18 19
19 // Returns a new Java byte array converted from the given bytes array. 20 // Returns a new Java byte array converted from the given bytes array.
20 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(JNIEnv* env, 21 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(JNIEnv* env,
21 const uint8_t* bytes, 22 const uint8_t* bytes,
22 size_t len); 23 size_t len);
23 24
24 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray( 25 BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(
25 JNIEnv* env, 26 JNIEnv* env,
26 const std::vector<uint8_t>& bytes); 27 const std::vector<uint8_t>& bytes);
27 28
28 // Returns a new Java int array converted from the given int array. 29 // Returns a new Java int array converted from the given int array.
29 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( 30 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray(
30 JNIEnv* env, const int* ints, size_t len); 31 JNIEnv* env, const int* ints, size_t len);
31 32
32 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray( 33 BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray(
33 JNIEnv* env, const std::vector<int>& ints); 34 JNIEnv* env, const std::vector<int>& ints);
34 35
35 // Returns a new Java long array converted from the given int64 array. 36 // Returns a new Java long array converted from the given int64_t array.
36 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(JNIEnv* env, 37 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(JNIEnv* env,
37 const int64_t* longs, 38 const int64_t* longs,
38 size_t len); 39 size_t len);
39 40
40 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray( 41 BASE_EXPORT ScopedJavaLocalRef<jlongArray> ToJavaLongArray(
41 JNIEnv* env, 42 JNIEnv* env,
42 const std::vector<int64_t>& longs); 43 const std::vector<int64_t>& longs);
43 44
44 // Returns a array of Java byte array converted from |v|. 45 // Returns a array of Java byte array converted from |v|.
45 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray( 46 BASE_EXPORT ScopedJavaLocalRef<jobjectArray> ToJavaArrayOfByteArray(
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // contents of |out| with the corresponding vectors of ints. 108 // contents of |out| with the corresponding vectors of ints.
108 BASE_EXPORT void JavaArrayOfIntArrayToIntVector( 109 BASE_EXPORT void JavaArrayOfIntArrayToIntVector(
109 JNIEnv* env, 110 JNIEnv* env,
110 jobjectArray array, 111 jobjectArray array,
111 std::vector<std::vector<int>>* out); 112 std::vector<std::vector<int>>* out);
112 113
113 } // namespace android 114 } // namespace android
114 } // namespace base 115 } // namespace base
115 116
116 #endif // BASE_ANDROID_JNI_ARRAY_H_ 117 #endif // BASE_ANDROID_JNI_ARRAY_H_
OLDNEW
« no previous file with comments | « base/android/jni_android.cc ('k') | base/android/jni_array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698