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

Unified Diff: base/android/jni_array.cc

Issue 1314753002: [Android] Adding JavaLongArrayToInt64Vector method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removing reinterpret_cast Created 5 years, 4 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') | no next file » | 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 1bbc66997bdea1f9b7e52022287b08b90c3fec57..bc922f883c2f8c296fbbfdd4a2590afc2fb11bc9 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -185,6 +185,16 @@ void JavaIntArrayToIntVector(JNIEnv* env,
env->GetIntArrayRegion(int_array, 0, len, &(*out)[0]);
}
+void JavaLongArrayToInt64Vector(JNIEnv* env,
+ jlongArray long_array,
+ std::vector<int64>* out) {
+ DCHECK(out);
+ std::vector<jlong> temp;
+ JavaLongArrayToLongVector(env, long_array, &temp);
+ out->resize(0);
+ out->insert(out->begin(), temp.begin(), temp.end());
+}
+
void JavaLongArrayToLongVector(JNIEnv* env,
jlongArray long_array,
std::vector<jlong>* out) {
« no previous file with comments | « base/android/jni_array.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698