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

Side by Side Diff: mojo/common/common_type_converters.h

Issue 2608513002: Remove mojo::String. (Closed)
Patch Set: rebase Created 3 years, 11 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
« no previous file with comments | « media/capture/video/fake_video_capture_device.cc ('k') | mojo/common/common_type_converters.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include <vector> 9 #include <vector>
10 10
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_piece.h" 12 #include "base/strings/string_piece.h"
13 #include "mojo/common/mojo_common_export.h" 13 #include "mojo/common/mojo_common_export.h"
14 #include "mojo/public/cpp/bindings/array.h" 14 #include "mojo/public/cpp/bindings/array.h"
15 #include "mojo/public/cpp/bindings/string.h"
16 #include "mojo/public/cpp/bindings/type_converter.h" 15 #include "mojo/public/cpp/bindings/type_converter.h"
17 16
18 namespace mojo { 17 namespace mojo {
19 18
20 template <> 19 template <>
21 struct MOJO_COMMON_EXPORT TypeConverter<String, base::StringPiece> {
22 static String Convert(const base::StringPiece& input);
23 };
24
25 template <>
26 struct MOJO_COMMON_EXPORT TypeConverter<base::StringPiece, String> {
27 static base::StringPiece Convert(const String& input);
28 };
29
30 template <>
31 struct MOJO_COMMON_EXPORT TypeConverter<String, base::string16> {
32 static String Convert(const base::string16& input);
33 };
34
35 template <>
36 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, String> {
37 static base::string16 Convert(const String& input);
38 };
39
40 template <>
41 struct MOJO_COMMON_EXPORT TypeConverter<std::string, Array<uint8_t>> { 20 struct MOJO_COMMON_EXPORT TypeConverter<std::string, Array<uint8_t>> {
42 static std::string Convert(const Array<uint8_t>& input); 21 static std::string Convert(const Array<uint8_t>& input);
43 }; 22 };
44 23
45 template <> 24 template <>
46 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, std::string> { 25 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, std::string> {
47 static Array<uint8_t> Convert(const std::string& input); 26 static Array<uint8_t> Convert(const std::string& input);
48 }; 27 };
49 28
50 template <> 29 template <>
51 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::StringPiece> { 30 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::StringPiece> {
52 static Array<uint8_t> Convert(const base::StringPiece& input); 31 static Array<uint8_t> Convert(const base::StringPiece& input);
53 }; 32 };
54 33
55 template <> 34 template <>
56 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, Array<uint8_t>> { 35 struct MOJO_COMMON_EXPORT TypeConverter<base::string16, Array<uint8_t>> {
57 static base::string16 Convert(const Array<uint8_t>& input); 36 static base::string16 Convert(const Array<uint8_t>& input);
58 }; 37 };
59 38
60 template <> 39 template <>
61 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::string16> { 40 struct MOJO_COMMON_EXPORT TypeConverter<Array<uint8_t>, base::string16> {
62 static Array<uint8_t> Convert(const base::string16& input); 41 static Array<uint8_t> Convert(const base::string16& input);
63 }; 42 };
64 43
65 } // namespace mojo 44 } // namespace mojo
66 45
67 #endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_ 46 #endif // MOJO_COMMON_COMMON_TYPE_CONVERTERS_H_
OLDNEW
« no previous file with comments | « media/capture/video/fake_video_capture_device.cc ('k') | mojo/common/common_type_converters.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698