OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 |
(...skipping 27 matching lines...) Expand all Loading... |
38 class Rect; | 38 class Rect; |
39 class Size; | 39 class Size; |
40 } // namespace gfx | 40 } // namespace gfx |
41 | 41 |
42 namespace net { | 42 namespace net { |
43 class HttpResponseHeaders; | 43 class HttpResponseHeaders; |
44 class HostPortPair; | 44 class HostPortPair; |
45 class UploadData; | 45 class UploadData; |
46 } | 46 } |
47 | 47 |
| 48 namespace ui { |
| 49 class Range; |
| 50 } |
| 51 |
48 namespace webkit_glue { | 52 namespace webkit_glue { |
49 struct PasswordForm; | 53 struct PasswordForm; |
50 struct ResourceDevToolsInfo; | 54 struct ResourceDevToolsInfo; |
51 struct ResourceLoadTimingInfo; | 55 struct ResourceLoadTimingInfo; |
52 } | 56 } |
53 | 57 |
54 // Define the NPVariant_Param struct and its enum here since it needs manual | 58 // Define the NPVariant_Param struct and its enum here since it needs manual |
55 // serialization code. | 59 // serialization code. |
56 enum NPVariant_ParamEnum { | 60 enum NPVariant_ParamEnum { |
57 NPVARIANT_PARAM_VOID, | 61 NPVARIANT_PARAM_VOID, |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 } | 229 } |
226 return result; | 230 return result; |
227 #endif | 231 #endif |
228 } | 232 } |
229 static void Log(const param_type& p, std::string* l) { | 233 static void Log(const param_type& p, std::string* l) { |
230 l->append("<gfx::NativeWindow>"); | 234 l->append("<gfx::NativeWindow>"); |
231 } | 235 } |
232 }; | 236 }; |
233 | 237 |
234 template <> | 238 template <> |
| 239 struct ParamTraits<ui::Range> { |
| 240 typedef ui::Range param_type; |
| 241 static void Write(Message* m, const param_type& p); |
| 242 static bool Read(const Message* m, void** iter, param_type* r); |
| 243 static void Log(const param_type& p, std::string* l); |
| 244 }; |
| 245 |
| 246 template <> |
235 struct ParamTraits<scoped_refptr<webkit_blob::BlobData > > { | 247 struct ParamTraits<scoped_refptr<webkit_blob::BlobData > > { |
236 typedef scoped_refptr<webkit_blob::BlobData> param_type; | 248 typedef scoped_refptr<webkit_blob::BlobData> param_type; |
237 static void Write(Message* m, const param_type& p); | 249 static void Write(Message* m, const param_type& p); |
238 static bool Read(const Message* m, void** iter, param_type* r); | 250 static bool Read(const Message* m, void** iter, param_type* r); |
239 static void Log(const param_type& p, std::string* l); | 251 static void Log(const param_type& p, std::string* l); |
240 }; | 252 }; |
241 | 253 |
242 template <> | 254 template <> |
243 struct ParamTraits<NPVariant_Param> { | 255 struct ParamTraits<NPVariant_Param> { |
244 typedef NPVariant_Param param_type; | 256 typedef NPVariant_Param param_type; |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
427 struct ParamTraits<webkit_glue::PasswordForm> { | 439 struct ParamTraits<webkit_glue::PasswordForm> { |
428 typedef webkit_glue::PasswordForm param_type; | 440 typedef webkit_glue::PasswordForm param_type; |
429 static void Write(Message* m, const param_type& p); | 441 static void Write(Message* m, const param_type& p); |
430 static bool Read(const Message* m, void** iter, param_type* p); | 442 static bool Read(const Message* m, void** iter, param_type* p); |
431 static void Log(const param_type& p, std::string* l); | 443 static void Log(const param_type& p, std::string* l); |
432 }; | 444 }; |
433 | 445 |
434 } // namespace IPC | 446 } // namespace IPC |
435 | 447 |
436 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ | 448 #endif // CONTENT_COMMON_COMMON_PARAM_TRAITS_H_ |
OLD | NEW |