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

Side by Side 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: review comments 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_ 5 #ifndef MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
6 #define MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_ 6 #define MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
(...skipping 18 matching lines...) Expand all
29 template <> 29 template <>
30 struct MOJO_COMMON_EXPORT TypeConverter<String, base::string16> { 30 struct MOJO_COMMON_EXPORT TypeConverter<String, base::string16> {
31 static String Convert(const base::string16& input); 31 static String Convert(const base::string16& input);
32 }; 32 };
33 33
34 template <> 34 template <>
35 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, String> { 35 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, String> {
36 static base::string16 Convert(const String& input); 36 static base::string16 Convert(const String& input);
37 }; 37 };
38 38
39 // TODO(erg): In the very long term, we will want to remove conversion between
40 // std::strings and arrays of unsigned bytes. However, there is too much code
41 // across chrome which uses std::string as a bag of bytes that we probably
42 // don't want to roll this function at each callsite.
43 template <> 39 template <>
44 struct MOJO_COMMON_EXPORT TypeConverter<std::string, Array<uint8_t> > { 40 struct MOJO_COMMON_EXPORT TypeConverter<std::string, Array<uint8_t>> {
45 static std::string Convert(const Array<uint8_t>& input); 41 static std::string Convert(const Array<uint8_t>& input);
46 }; 42 };
47 43
48 template <> 44 template <>
49 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, std::string> { 45 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, std::string> {
50 static Array<uint8_t> Convert(const std::string& input); 46 static Array<uint8_t> Convert(const std::string& input);
51 }; 47 };
52 48
49 template <>
50 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, Array<uint8_t>> {
51 static base::string16 Convert(const Array<uint8_t>& input);
52 };
53
54 template <>
55 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::string16> {
56 static Array<uint8_t> Convert(const base::string16& input);
57 };
58
53 } // namespace mojo 59 } // namespace mojo
54 60
55 #endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_ 61 #endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
OLDNEW
« no previous file with comments | « content/renderer/dom_storage/local_storage_namespace.cc ('k') | mojo/common/common_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698