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

Unified Diff: base/android/jni_array.cc

Issue 10532155: Upstream some more content/ DEPS-related cleanup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove JNIHelper/BitmapHolder Created 8 years, 6 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') | content/app/android/content_jni_registrar.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 d70151f275b3d4ea63513f16d754845fb26455ab..0a55cc5fb39254de91323e9f32def68e2584fdb9 100644
--- a/base/android/jni_array.cc
+++ b/base/android/jni_array.cc
@@ -80,6 +80,20 @@ void AppendJavaStringArrayToStringVector(JNIEnv* env,
}
}
+void AppendJavaStringArrayToStringVector(JNIEnv* env,
+ jobjectArray array,
+ std::vector<std::string>* out) {
+ DCHECK(out);
+ if (!array)
+ return;
+ jsize len = env->GetArrayLength(array);
+ for (jsize i = 0; i < len; ++i) {
+ ScopedJavaLocalRef<jstring> str(env,
+ static_cast<jstring>(env->GetObjectArrayElement(array, i)));
+ out->push_back(ConvertJavaStringToUTF8(str));
+ }
+}
+
void AppendJavaByteArrayToByteVector(JNIEnv* env,
jbyteArray byte_array,
std::vector<uint8>* out) {
« no previous file with comments | « base/android/jni_array.h ('k') | content/app/android/content_jni_registrar.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698