Index: base/android/jni_map.h |
diff --git a/base/android/jni_map.h b/base/android/jni_map.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..59bfb69c80ef4d5e1e4fcd9b008fd5bcaebf5a59 |
--- /dev/null |
+++ b/base/android/jni_map.h |
@@ -0,0 +1,34 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef BASE_ANDROID_JNI_MAP_H_ |
+#define BASE_ANDROID_JNI_MAP_H_ |
+ |
+#include <jni.h> |
+#include <map> |
+#include <string> |
+ |
+#include "base/android/scoped_java_ref.h" |
+#include "base/base_export.h" |
+#include "base/string16.h" |
+ |
+namespace base { |
+namespace android { |
+ |
+// Convert a std::map<std::string, string16> to a Java HashMap<String, String> |
+BASE_EXPORT ScopedJavaLocalRef<jobject> ConvertMapToJavaMap( |
bulach
2013/02/22 12:49:25
..ToJavaHashMap (and below) ?
also, this is conve
|
+ JNIEnv* env, |
+ const std::map<std::string, string16>& cmap); |
+ |
+// Convert a Java subclass of map to std::map. Assumes values are string16. |
+// Any null key/values are dropped. |
+BASE_EXPORT std::map<std::string, string16> ConvertJavaMapToMap(JNIEnv* env, |
+ jobject jmap); |
+ |
+bool RegisterMap(JNIEnv* env); |
+ |
+} // namespace android |
+} // namespace base |
+ |
+#endif // BASE_ANDROID_JNI_MAP_H_ |