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 11 matching lines...) Expand all Loading... |
22 namespace gfx { | 22 namespace gfx { |
23 class Point; | 23 class Point; |
24 class PointF; | 24 class PointF; |
25 class Point3F; | 25 class Point3F; |
26 class Range; | 26 class Range; |
27 class Rect; | 27 class Rect; |
28 class RectF; | 28 class RectF; |
29 class ScrollOffset; | 29 class ScrollOffset; |
30 class Size; | 30 class Size; |
31 class SizeF; | 31 class SizeF; |
| 32 class Transform; |
32 class Vector2d; | 33 class Vector2d; |
33 class Vector2dF; | 34 class Vector2dF; |
34 } // namespace gfx | 35 } // namespace gfx |
35 | 36 |
36 namespace IPC { | 37 namespace IPC { |
37 | 38 |
38 template <> | 39 template <> |
39 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> { | 40 struct GFX_IPC_EXPORT ParamTraits<gfx::Point> { |
40 typedef gfx::Point param_type; | 41 typedef gfx::Point param_type; |
41 static void Write(base::Pickle* m, const param_type& p); | 42 static void Write(base::Pickle* m, const param_type& p); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 template <> | 156 template <> |
156 struct GFX_IPC_EXPORT ParamTraits<gfx::ScrollOffset> { | 157 struct GFX_IPC_EXPORT ParamTraits<gfx::ScrollOffset> { |
157 typedef gfx::ScrollOffset param_type; | 158 typedef gfx::ScrollOffset param_type; |
158 static void Write(base::Pickle* m, const param_type& p); | 159 static void Write(base::Pickle* m, const param_type& p); |
159 static bool Read(const base::Pickle* m, | 160 static bool Read(const base::Pickle* m, |
160 base::PickleIterator* iter, | 161 base::PickleIterator* iter, |
161 param_type* r); | 162 param_type* r); |
162 static void Log(const param_type& p, std::string* l); | 163 static void Log(const param_type& p, std::string* l); |
163 }; | 164 }; |
164 | 165 |
| 166 template <> |
| 167 struct GFX_IPC_EXPORT ParamTraits<gfx::Transform> { |
| 168 typedef gfx::Transform param_type; |
| 169 static void Write(base::Pickle* m, const param_type& p); |
| 170 static bool Read(const base::Pickle* m, |
| 171 base::PickleIterator* iter, |
| 172 param_type* r); |
| 173 static void Log(const param_type& p, std::string* l); |
| 174 }; |
| 175 |
165 #if defined(OS_MACOSX) && !defined(OS_IOS) | 176 #if defined(OS_MACOSX) && !defined(OS_IOS) |
166 template <> | 177 template <> |
167 struct GFX_IPC_EXPORT ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort> { | 178 struct GFX_IPC_EXPORT ParamTraits<gfx::ScopedRefCountedIOSurfaceMachPort> { |
168 typedef gfx::ScopedRefCountedIOSurfaceMachPort param_type; | 179 typedef gfx::ScopedRefCountedIOSurfaceMachPort param_type; |
169 static void Write(base::Pickle* m, const param_type p); | 180 static void Write(base::Pickle* m, const param_type p); |
170 // Note: Read() passes ownership of the Mach send right from the IPC message | 181 // Note: Read() passes ownership of the Mach send right from the IPC message |
171 // to the ScopedRefCountedIOSurfaceMachPort. Therefore, Read() may only be | 182 // to the ScopedRefCountedIOSurfaceMachPort. Therefore, Read() may only be |
172 // called once for a given message, otherwise the singular right will be | 183 // called once for a given message, otherwise the singular right will be |
173 // managed and released by two objects. | 184 // managed and released by two objects. |
174 static bool Read(const base::Pickle* m, | 185 static bool Read(const base::Pickle* m, |
175 base::PickleIterator* iter, | 186 base::PickleIterator* iter, |
176 param_type* r); | 187 param_type* r); |
177 static void Log(const param_type& p, std::string* l); | 188 static void Log(const param_type& p, std::string* l); |
178 }; | 189 }; |
179 #endif // defined(OS_MACOSX) && !defined(OS_IOS) | 190 #endif // defined(OS_MACOSX) && !defined(OS_IOS) |
180 | 191 |
181 } // namespace IPC | 192 } // namespace IPC |
182 | 193 |
183 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ | 194 #endif // UI_GFX_IPC_GFX_PARAM_TRAITS_H_ |
OLD | NEW |