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

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: Address comments. Created 5 years, 10 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
Index: base/android/jni_array.cc
diff --git a/base/android/jni_array.cc b/base/android/jni_array.cc
index a1573543d09fe75fb7037b9559a56d7df05d4aae..35b6b2800d87c8fd50a3a9ec03994caa81fee231 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<long>* 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) {

Powered by Google App Engine
This is Rietveld 408576698