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_GFX_PARAM_TRAITS_H_ | 5 #ifndef UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
6 #define UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 6 #define UI_GFX_IPC_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 30 matching lines...) Expand all Loading... |
41 static void Write(base::Pickle* m, const param_type& p); | 41 static void Write(base::Pickle* m, const param_type& p); |
42 static bool Read(const base::Pickle* m, | 42 static bool Read(const base::Pickle* m, |
43 base::PickleIterator* iter, | 43 base::PickleIterator* iter, |
44 param_type* r); | 44 param_type* r); |
45 static void Log(const param_type& p, std::string* l); | 45 static void Log(const param_type& p, std::string* l); |
46 }; | 46 }; |
47 | 47 |
48 template <> | 48 template <> |
49 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> { | 49 struct GFX_IPC_EXPORT ParamTraits<gfx::PointF> { |
50 typedef gfx::PointF param_type; | 50 typedef gfx::PointF param_type; |
| 51 static void GetSize(base::PickleSizer* s, const param_type& p); |
51 static void Write(base::Pickle* m, const param_type& p); | 52 static void Write(base::Pickle* m, const param_type& p); |
52 static bool Read(const base::Pickle* m, | 53 static bool Read(const base::Pickle* m, |
53 base::PickleIterator* iter, | 54 base::PickleIterator* iter, |
54 param_type* r); | 55 param_type* r); |
55 static void Log(const param_type& p, std::string* l); | 56 static void Log(const param_type& p, std::string* l); |
56 }; | 57 }; |
57 | 58 |
58 template <> | 59 template <> |
59 struct GFX_IPC_EXPORT ParamTraits<gfx::Point3F> { | 60 struct GFX_IPC_EXPORT ParamTraits<gfx::Point3F> { |
60 typedef gfx::Point3F param_type; | 61 typedef gfx::Point3F param_type; |
(...skipping 20 matching lines...) Expand all Loading... |
81 static void Write(base::Pickle* m, const param_type& p); | 82 static void Write(base::Pickle* m, const param_type& p); |
82 static bool Read(const base::Pickle* m, | 83 static bool Read(const base::Pickle* m, |
83 base::PickleIterator* iter, | 84 base::PickleIterator* iter, |
84 param_type* r); | 85 param_type* r); |
85 static void Log(const param_type& p, std::string* l); | 86 static void Log(const param_type& p, std::string* l); |
86 }; | 87 }; |
87 | 88 |
88 template <> | 89 template <> |
89 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2d> { | 90 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2d> { |
90 typedef gfx::Vector2d param_type; | 91 typedef gfx::Vector2d param_type; |
| 92 static void GetSize(base::PickleSizer* s, const param_type& p); |
91 static void Write(base::Pickle* m, const param_type& p); | 93 static void Write(base::Pickle* m, const param_type& p); |
92 static bool Read(const base::Pickle* m, | 94 static bool Read(const base::Pickle* m, |
93 base::PickleIterator* iter, | 95 base::PickleIterator* iter, |
94 param_type* r); | 96 param_type* r); |
95 static void Log(const param_type& p, std::string* l); | 97 static void Log(const param_type& p, std::string* l); |
96 }; | 98 }; |
97 | 99 |
98 template <> | 100 template <> |
99 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2dF> { | 101 struct GFX_IPC_EXPORT ParamTraits<gfx::Vector2dF> { |
100 typedef gfx::Vector2dF param_type; | 102 typedef gfx::Vector2dF param_type; |
(...skipping 10 matching lines...) Expand all Loading... |
111 static void Write(base::Pickle* m, const param_type& p); | 113 static void Write(base::Pickle* m, const param_type& p); |
112 static bool Read(const base::Pickle* m, | 114 static bool Read(const base::Pickle* m, |
113 base::PickleIterator* iter, | 115 base::PickleIterator* iter, |
114 param_type* r); | 116 param_type* r); |
115 static void Log(const param_type& p, std::string* l); | 117 static void Log(const param_type& p, std::string* l); |
116 }; | 118 }; |
117 | 119 |
118 template <> | 120 template <> |
119 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> { | 121 struct GFX_IPC_EXPORT ParamTraits<gfx::RectF> { |
120 typedef gfx::RectF param_type; | 122 typedef gfx::RectF param_type; |
| 123 static void GetSize(base::PickleSizer* s, const param_type& p); |
121 static void Write(base::Pickle* m, const param_type& p); | 124 static void Write(base::Pickle* m, const param_type& p); |
122 static bool Read(const base::Pickle* m, | 125 static bool Read(const base::Pickle* m, |
123 base::PickleIterator* iter, | 126 base::PickleIterator* iter, |
124 param_type* r); | 127 param_type* r); |
125 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
126 }; | 129 }; |
127 | 130 |
128 template <> | 131 template <> |
129 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { | 132 struct GFX_IPC_EXPORT ParamTraits<SkBitmap> { |
130 typedef SkBitmap param_type; | 133 typedef SkBitmap param_type; |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 static bool Read(const base::Pickle* m, | 174 static bool Read(const base::Pickle* m, |
172 base::PickleIterator* iter, | 175 base::PickleIterator* iter, |
173 param_type* r); | 176 param_type* r); |
174 static void Log(const param_type& p, std::string* l); | 177 static void Log(const param_type& p, std::string* l); |
175 }; | 178 }; |
176 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 179 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
177 | 180 |
178 } // namespace IPC | 181 } // namespace IPC |
179 | 182 |
180 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 183 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
OLD | NEW |