OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file is used to define IPC::ParamTraits<> specializations for a number | 5 // This file is used to define IPC::ParamTraits<> specializations for a number |
6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> | 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> |
7 // specializations for basic types (like int and std::string) and types in the | 7 // specializations for basic types (like int and std::string) and types in the |
8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains | 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains |
9 // specializations for types that are used by the content code, and which need | 9 // specializations for types that are used by the content code, and which need |
10 // manual serialization code. This is usually because they're not structs with | 10 // manual serialization code. This is usually because they're not structs with |
11 // public members, or because the same type is being used in multiple | 11 // public members, or because the same type is being used in multiple |
12 // *_messages.h headers. | 12 // *_messages.h headers. |
13 | 13 |
14 #ifndef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ | 14 #ifndef CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ |
15 #define CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ | 15 #define CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ |
16 | 16 |
17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
19 #include "content/public/common/common_param_traits_macros.h" | 19 #include "content/public/common/common_param_traits_macros.h" |
20 #include "googleurl/src/gurl.h" | 20 #include "googleurl/src/gurl.h" |
21 #include "ipc/ipc_message_utils.h" | 21 #include "ipc/ipc_message_utils.h" |
22 #include "net/base/ip_endpoint.h" | 22 #include "net/base/ip_endpoint.h" |
23 #include "net/url_request/url_request_status.h" | 23 #include "net/url_request/url_request_status.h" |
24 #include "ui/gfx/native_widget_types.h" | 24 #include "ui/gfx/native_widget_types.h" |
25 #include "ui/surface/transport_dib.h" | 25 #include "ui/surface/transport_dib.h" |
26 | 26 |
27 class SkBitmap; | 27 class SkBitmap; |
28 | 28 |
29 namespace content { | 29 namespace content { |
| 30 struct DraggableRegion; |
30 struct Referrer; | 31 struct Referrer; |
31 } | 32 } |
32 | 33 |
33 namespace gfx { | 34 namespace gfx { |
34 class Point; | 35 class Point; |
35 class Rect; | 36 class Rect; |
36 class RectF; | 37 class RectF; |
37 class Size; | 38 class Size; |
38 } // namespace gfx | 39 } // namespace gfx |
39 | 40 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 typedef SkBitmap param_type; | 223 typedef SkBitmap param_type; |
223 static void Write(Message* m, const param_type& p); | 224 static void Write(Message* m, const param_type& p); |
224 | 225 |
225 // Note: This function expects parameter |r| to be of type &SkBitmap since | 226 // Note: This function expects parameter |r| to be of type &SkBitmap since |
226 // r->SetConfig() and r->SetPixels() are called. | 227 // r->SetConfig() and r->SetPixels() are called. |
227 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 228 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
228 | 229 |
229 static void Log(const param_type& p, std::string* l); | 230 static void Log(const param_type& p, std::string* l); |
230 }; | 231 }; |
231 | 232 |
| 233 template <> |
| 234 struct CONTENT_EXPORT ParamTraits<content::DraggableRegion> { |
| 235 typedef content::DraggableRegion param_type; |
| 236 static void Write(Message* m, const param_type& p); |
| 237 static bool Read(const Message* m, PickleIterator* iter, param_type* p); |
| 238 static void Log(const param_type& p, std::string* l); |
| 239 }; |
| 240 |
232 } // namespace IPC | 241 } // namespace IPC |
233 | 242 |
234 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ | 243 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ |
OLD | NEW |