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

Unified Diff: mojo/common/common_type_converters.h

Issue 1814003002: Implement the renderer side of the mojo based local storage implementation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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: mojo/common/common_type_converters.h
diff --git a/mojo/common/common_type_converters.h b/mojo/common/common_type_converters.h
index 5f6e3c592099175c77f0819cc06a6816db24f1c7..611886a9a3083e2199a013e79c1870287dcc2684 100644
--- a/mojo/common/common_type_converters.h
+++ b/mojo/common/common_type_converters.h
@@ -36,10 +36,6 @@ struct MOJO_COMMON_EXPORT TypeConverter<base::string16, String> {
static base::string16 Convert(const String& input);
};
-// TODO(erg): In the very long term, we will want to remove conversion between
-// std::strings and arrays of unsigned bytes. However, there is too much code
-// across chrome which uses std::string as a bag of bytes that we probably
-// don't want to roll this function at each callsite.
template <>
struct MOJO_COMMON_EXPORT TypeConverter<std::string, Array<uint8_t> > {
static std::string Convert(const Array<uint8_t>& input);
@@ -50,6 +46,16 @@ struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, std::string> {
static Array<uint8_t> Convert(const std::string& input);
};
+template <>
+struct MOJO_COMMON_EXPORT TypeConverter<base::string16, Array<uint8_t> > {
dcheng 2016/03/18 06:35:29 Nit: >>
jam 2016/03/18 16:48:33 Done.
+ static base::string16 Convert(const Array<uint8_t>& input);
+};
+
+template <>
+struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::string16> {
+ static Array<uint8_t> Convert(const base::string16& input);
+};
+
} // namespace mojo
#endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_

Powered by Google App Engine
This is Rietveld 408576698