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

Unified Diff: base/android/jni_array.h

Issue 2877703006: Add functions to convert boolean jni array. (Closed)
Patch Set: Created 3 years, 7 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/android/jni_array.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_array.h
diff --git a/base/android/jni_array.h b/base/android/jni_array.h
index 58282b1b0c7dfacc443f8fb253f1083ee7fcd02e..66c56ef3097448887ca8915368eed40c09b08b4b 100644
--- a/base/android/jni_array.h
+++ b/base/android/jni_array.h
@@ -26,6 +26,10 @@ BASE_EXPORT ScopedJavaLocalRef<jbyteArray> ToJavaByteArray(
JNIEnv* env,
const std::vector<uint8_t>& bytes);
+// Returns a new Java boolean array converted from the given bool array.
+BASE_EXPORT ScopedJavaLocalRef<jbooleanArray>
+ToJavaBooleanArray(JNIEnv* env, const bool* bools, size_t len);
+
// Returns a new Java int array converted from the given int array.
BASE_EXPORT ScopedJavaLocalRef<jintArray> ToJavaIntArray(
JNIEnv* env, const int* ints, size_t len);
@@ -81,6 +85,11 @@ BASE_EXPORT void JavaByteArrayToByteVector(JNIEnv* env,
jbyteArray byte_array,
std::vector<uint8_t>* out);
+// Replaces the content of |out| with the Java booleans in |boolean_array|.
+BASE_EXPORT void JavaBooleanArrayToBoolVector(JNIEnv* env,
+ jbooleanArray boolean_array,
+ std::vector<bool>* out);
+
// Replaces the content of |out| with the Java ints in |int_array|.
BASE_EXPORT void JavaIntArrayToIntVector(
JNIEnv* env,
« no previous file with comments | « no previous file | base/android/jni_array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698