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

Unified Diff: base/android/jni_array.cc

Issue 2735113003: Changing SpawnChild to return a struct.
Patch Set: Created 3 years, 9 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 | « base/android/jni_array.h ('k') | base/android/parcelable_channel_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/jni_array.cc
diff --git a/base/android/jni_array.cc b/base/android/jni_array.cc
index 2ce04299439f1e45fc6699cda1d02616b78fc4db..ce8f9d3d8335a7354b3e96cf0ef298051a0df6b0 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -246,6 +246,22 @@ void JavaFloatArrayToFloatVector(JNIEnv* env,
env->GetFloatArrayRegion(float_array, 0, len, &(*out)[0]);
}
+void JavaJObjectArrayToJObjectVector(
+ JNIEnv* env,
+ jobjectArray jobject_array,
+ std::vector<ScopedJavaLocalRef<jobject>>* out) {
+ DCHECK(out);
+ size_t len = SafeGetArrayLength(env, jobject_array);
+ if (!len)
+ return;
+ out->reserve(len);
+
+ for (size_t i = 0; i < len; ++i) {
+ out->push_back(ScopedJavaLocalRef<jobject>(
+ env, env->GetObjectArrayElement(jobject_array, i)));
+ }
+}
+
void JavaArrayOfByteArrayToStringVector(
JNIEnv* env,
jobjectArray array,
« no previous file with comments | « base/android/jni_array.h ('k') | base/android/parcelable_channel_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698