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

Unified Diff: base/android/callback_android.cc

Issue 2804913003: Remove redundant code from Android context menu native. (Closed)
Patch Set: Address dtrainor@ comments Created 3 years, 8 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/callback_android.h ('k') | base/android/java/src/org/chromium/base/Callback.java » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/android/callback_android.cc
diff --git a/base/android/callback_android.cc b/base/android/callback_android.cc
index 2326d85524b72dc32a11cc518df58455530a5d90..a97deab6d66653f2d5c1075c31785a9cba1b2c97 100644
--- a/base/android/callback_android.cc
+++ b/base/android/callback_android.cc
@@ -4,6 +4,8 @@
#include "base/android/callback_android.h"
+#include "base/android/jni_array.h"
+#include "base/android/scoped_java_ref.h"
#include "jni/Callback_jni.h"
namespace base {
@@ -25,5 +27,13 @@ void RunCallbackAndroid(const JavaRef<jobject>& callback, int arg) {
callback, arg);
}
+void RunCallbackAndroid(const JavaRef<jobject>& callback,
+ const std::vector<uint8_t>& arg) {
+ JNIEnv* env = base::android::AttachCurrentThread();
+ base::android::ScopedJavaLocalRef<jbyteArray> j_bytes =
+ base::android::ToJavaByteArray(env, arg);
+ Java_Callback_onResultFromNativeV_AB(env, callback, j_bytes);
+}
+
} // namespace android
} // namespace base
« no previous file with comments | « base/android/callback_android.h ('k') | base/android/java/src/org/chromium/base/Callback.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698