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

Unified Diff: base/android/jni_array.cc

Issue 401743003: [android_webview] Introduce AwAssets to reference assets inside the apk. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@pakfiles
Patch Set: One char fix to make clang happy Created 6 years, 5 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 6c7ac5bfa52daf50e546133f31ad43f377d3274a..3c064138381d580a12a77062d3d90a5abd21ac32 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -167,6 +167,19 @@ void JavaIntArrayToIntVector(JNIEnv* env,
env->ReleaseIntArrayElements(int_array, ints, JNI_ABORT);
}
+void JavaLongArrayToLongVector(JNIEnv* env,
+ jlongArray long_array,
+ std::vector<long>* out) {
+ DCHECK(out);
+ out->clear();
+ jsize len = env->GetArrayLength(long_array);
+ jlong* longs = env->GetLongArrayElements(long_array, NULL);
+ for (jsize i = 0; i < len; ++i) {
+ out->push_back(static_cast<long>(longs[i]));
+ }
+ env->ReleaseLongArrayElements(long_array, longs, JNI_ABORT);
+}
+
void JavaFloatArrayToFloatVector(JNIEnv* env,
jfloatArray float_array,
std::vector<float>* 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