OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ |
6 #define UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "ipc/ipc_message_utils.h" | 10 #include "ipc/ipc_message_utils.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class SizeF; | 22 class SizeF; |
23 class Vector2d; | 23 class Vector2d; |
24 class Vector2dF; | 24 class Vector2dF; |
25 } // namespace gfx | 25 } // namespace gfx |
26 | 26 |
27 namespace IPC { | 27 namespace IPC { |
28 | 28 |
29 template <> | 29 template <> |
30 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point> { | 30 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point> { |
31 typedef gfx::Point param_type; | 31 typedef gfx::Point param_type; |
| 32 static void GetSize(base::PickleSizer* s, const param_type& p); |
32 static void Write(base::Pickle* m, const param_type& p); | 33 static void Write(base::Pickle* m, const param_type& p); |
33 static bool Read(const base::Pickle* m, | 34 static bool Read(const base::Pickle* m, |
34 base::PickleIterator* iter, | 35 base::PickleIterator* iter, |
35 param_type* r); | 36 param_type* r); |
36 static void Log(const param_type& p, std::string* l); | 37 static void Log(const param_type& p, std::string* l); |
37 }; | 38 }; |
38 | 39 |
39 template <> | 40 template <> |
40 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::PointF> { | 41 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::PointF> { |
41 typedef gfx::PointF param_type; | 42 typedef gfx::PointF param_type; |
42 static void GetSize(base::PickleSizer* s, const param_type& p); | 43 static void GetSize(base::PickleSizer* s, const param_type& p); |
43 static void Write(base::Pickle* m, const param_type& p); | 44 static void Write(base::Pickle* m, const param_type& p); |
44 static bool Read(const base::Pickle* m, | 45 static bool Read(const base::Pickle* m, |
45 base::PickleIterator* iter, | 46 base::PickleIterator* iter, |
46 param_type* r); | 47 param_type* r); |
47 static void Log(const param_type& p, std::string* l); | 48 static void Log(const param_type& p, std::string* l); |
48 }; | 49 }; |
49 | 50 |
50 template <> | 51 template <> |
51 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point3F> { | 52 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Point3F> { |
52 typedef gfx::Point3F param_type; | 53 typedef gfx::Point3F param_type; |
| 54 static void GetSize(base::PickleSizer* s, const param_type& p); |
53 static void Write(base::Pickle* m, const param_type& p); | 55 static void Write(base::Pickle* m, const param_type& p); |
54 static bool Read(const base::Pickle* m, | 56 static bool Read(const base::Pickle* m, |
55 base::PickleIterator* iter, | 57 base::PickleIterator* iter, |
56 param_type* r); | 58 param_type* r); |
57 static void Log(const param_type& p, std::string* l); | 59 static void Log(const param_type& p, std::string* l); |
58 }; | 60 }; |
59 | 61 |
60 template <> | 62 template <> |
61 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Size> { | 63 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Size> { |
62 typedef gfx::Size param_type; | 64 typedef gfx::Size param_type; |
| 65 static void GetSize(base::PickleSizer* s, const param_type& p); |
63 static void Write(base::Pickle* m, const param_type& p); | 66 static void Write(base::Pickle* m, const param_type& p); |
64 static bool Read(const base::Pickle* m, | 67 static bool Read(const base::Pickle* m, |
65 base::PickleIterator* iter, | 68 base::PickleIterator* iter, |
66 param_type* r); | 69 param_type* r); |
67 static void Log(const param_type& p, std::string* l); | 70 static void Log(const param_type& p, std::string* l); |
68 }; | 71 }; |
69 | 72 |
70 template <> | 73 template <> |
71 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::SizeF> { | 74 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::SizeF> { |
72 typedef gfx::SizeF param_type; | 75 typedef gfx::SizeF param_type; |
| 76 static void GetSize(base::PickleSizer* s, const param_type& p); |
73 static void Write(base::Pickle* m, const param_type& p); | 77 static void Write(base::Pickle* m, const param_type& p); |
74 static bool Read(const base::Pickle* m, | 78 static bool Read(const base::Pickle* m, |
75 base::PickleIterator* iter, | 79 base::PickleIterator* iter, |
76 param_type* r); | 80 param_type* r); |
77 static void Log(const param_type& p, std::string* l); | 81 static void Log(const param_type& p, std::string* l); |
78 }; | 82 }; |
79 | 83 |
80 template <> | 84 template <> |
81 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2d> { | 85 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2d> { |
82 typedef gfx::Vector2d param_type; | 86 typedef gfx::Vector2d param_type; |
83 static void GetSize(base::PickleSizer* s, const param_type& p); | 87 static void GetSize(base::PickleSizer* s, const param_type& p); |
84 static void Write(base::Pickle* m, const param_type& p); | 88 static void Write(base::Pickle* m, const param_type& p); |
85 static bool Read(const base::Pickle* m, | 89 static bool Read(const base::Pickle* m, |
86 base::PickleIterator* iter, | 90 base::PickleIterator* iter, |
87 param_type* r); | 91 param_type* r); |
88 static void Log(const param_type& p, std::string* l); | 92 static void Log(const param_type& p, std::string* l); |
89 }; | 93 }; |
90 | 94 |
91 template <> | 95 template <> |
92 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2dF> { | 96 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Vector2dF> { |
93 typedef gfx::Vector2dF param_type; | 97 typedef gfx::Vector2dF param_type; |
| 98 static void GetSize(base::PickleSizer* s, const param_type& p); |
94 static void Write(base::Pickle* m, const param_type& p); | 99 static void Write(base::Pickle* m, const param_type& p); |
95 static bool Read(const base::Pickle* m, | 100 static bool Read(const base::Pickle* m, |
96 base::PickleIterator* iter, | 101 base::PickleIterator* iter, |
97 param_type* r); | 102 param_type* r); |
98 static void Log(const param_type& p, std::string* l); | 103 static void Log(const param_type& p, std::string* l); |
99 }; | 104 }; |
100 | 105 |
101 template <> | 106 template <> |
102 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Rect> { | 107 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::Rect> { |
103 typedef gfx::Rect param_type; | 108 typedef gfx::Rect param_type; |
| 109 static void GetSize(base::PickleSizer* s, const param_type& p); |
104 static void Write(base::Pickle* m, const param_type& p); | 110 static void Write(base::Pickle* m, const param_type& p); |
105 static bool Read(const base::Pickle* m, | 111 static bool Read(const base::Pickle* m, |
106 base::PickleIterator* iter, | 112 base::PickleIterator* iter, |
107 param_type* r); | 113 param_type* r); |
108 static void Log(const param_type& p, std::string* l); | 114 static void Log(const param_type& p, std::string* l); |
109 }; | 115 }; |
110 | 116 |
111 template <> | 117 template <> |
112 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::RectF> { | 118 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::RectF> { |
113 typedef gfx::RectF param_type; | 119 typedef gfx::RectF param_type; |
114 static void GetSize(base::PickleSizer* s, const param_type& p); | 120 static void GetSize(base::PickleSizer* s, const param_type& p); |
115 static void Write(base::Pickle* m, const param_type& p); | 121 static void Write(base::Pickle* m, const param_type& p); |
116 static bool Read(const base::Pickle* m, | 122 static bool Read(const base::Pickle* m, |
117 base::PickleIterator* iter, | 123 base::PickleIterator* iter, |
118 param_type* r); | 124 param_type* r); |
119 static void Log(const param_type& p, std::string* l); | 125 static void Log(const param_type& p, std::string* l); |
120 }; | 126 }; |
121 | 127 |
122 template <> | 128 template <> |
123 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::ScrollOffset> { | 129 struct GFX_IPC_GEOMETRY_EXPORT ParamTraits<gfx::ScrollOffset> { |
124 typedef gfx::ScrollOffset param_type; | 130 typedef gfx::ScrollOffset param_type; |
| 131 static void GetSize(base::PickleSizer* s, const param_type& p); |
125 static void Write(base::Pickle* m, const param_type& p); | 132 static void Write(base::Pickle* m, const param_type& p); |
126 static bool Read(const base::Pickle* m, | 133 static bool Read(const base::Pickle* m, |
127 base::PickleIterator* iter, | 134 base::PickleIterator* iter, |
128 param_type* r); | 135 param_type* r); |
129 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
130 }; | 137 }; |
131 | 138 |
132 } // namespace IPC | 139 } // namespace IPC |
133 | 140 |
134 #endif // UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ | 141 #endif // UI_GFX_IPC_GEOMETRY_GFX_PARAM_TRAITS_H_ |
OLD | NEW |