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

Unified Diff: base/android/jni_array.cc

Issue 874543003: Add support for TraceEvent before the native library is loaded. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comments, cleanup and a JNI unittest. Created 5 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/jni_array_unittest.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 a1573543d09fe75fb7037b9559a56d7df05d4aae..3ad9b5757583dd4f5eb7171d038009597e98452f 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -163,6 +163,18 @@ void AppendJavaByteArrayToByteVector(JNIEnv* env,
reinterpret_cast<int8*>(&(*out)[back]));
}
+void AppendJavaLongArrayToLongVector(JNIEnv* env,
+ jlongArray long_array,
+ std::vector<int64_t>* out) {
+ DCHECK(out);
+ if (!long_array)
+ return;
+ jsize len = env->GetArrayLength(long_array);
+ jlong* longs = env->GetLongArrayElements(long_array, NULL);
+ out->insert(out->end(), longs, longs + len);
+ env->ReleaseLongArrayElements(long_array, longs, JNI_ABORT);
+}
+
void JavaByteArrayToByteVector(JNIEnv* env,
jbyteArray byte_array,
std::vector<uint8>* out) {
« no previous file with comments | « base/android/jni_array.h ('k') | base/android/jni_array_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698