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

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: 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..8df2e24decbf5a2eecb5884764ed2badbc6477e0 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -185,6 +185,17 @@ 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);
+ size_t len = SafeGetArrayLength(env, long_array);
+ out->resize(len);
+ if (!len)
+ return;
+ env->GetLongArrayRegion(long_array, 0, len, &(*out)[0]);
DmitrySkiba 2015/08/25 14:31:44 Hmm, this should produce a warning because GetLong
fgorski 2015/08/25 18:37:55 Good point, I am testing the updated version now.
+}
+
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