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..b2e333c52c702c25d1ad78f5e8df93357911b345 |
--- /dev/null |
+++ b/base/android/jni_map.h |
@@ -0,0 +1,32 @@ |
+// 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. |
nyquist
2013/02/20 07:33:09
Mention the generics type of the Java HashMap (<St
Yaron
2013/02/21 21:39:15
Done.
|
+BASE_EXPORT ScopedJavaLocalRef<jobject> ConvertMapToJavaMap( |
+ JNIEnv* env, |
+ const std::map<std::string, string16>& cmap); |
+ |
+// Convert a Java subclass of map to std::map. Assumes values are string16 |
+BASE_EXPORT std::map<std::string, string16> ConvertJavaMapToMap(JNIEnv* env, |
nyquist
2013/02/20 07:33:09
Since you throw out both null keys and even null v
Yaron
2013/02/21 21:39:15
Done.
|
+ jobject jmap); |
+ |
+} // namespace android |
+} // namespace base |
+ |
+#endif // BASE_ANDROID_JNI_MAP_H_ |
+ |
bulach
2013/02/20 14:41:25
nit: extra \n
Yaron
2013/02/21 21:39:15
Done.
|