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

Unified Diff: base/android/jni_array.cc

Issue 10696025: Upstream ChildProcessLauncher changes for Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add additional assert and comments Created 8 years, 6 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') | content/app/android/sandboxed_process_service.cc » ('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 0a55cc5fb39254de91323e9f32def68e2584fdb9..53027c7255b67e6044d1ee7067905acbb4f3afad 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -114,5 +114,18 @@ void JavaByteArrayToByteVector(JNIEnv* env,
AppendJavaByteArrayToByteVector(env, byte_array, out);
}
+void JavaIntArrayToIntVector(JNIEnv* env,
+ jintArray array,
+ std::vector<int>* out) {
+ DCHECK(out);
+ out->clear();
+ jsize len = env->GetArrayLength(array);
+ jint* ints = env->GetIntArrayElements(array, NULL);
+ for (jsize i = 0; i < len; ++i) {
+ out->push_back(static_cast<int>(ints[i]));
+ }
+ env->ReleaseIntArrayElements(array, ints, JNI_ABORT);
+}
+
} // namespace android
} // namespace base
« no previous file with comments | « base/android/jni_array.h ('k') | content/app/android/sandboxed_process_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698