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 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
27 #include "ui/surface/transport_dib.h" | 27 #include "ui/surface/transport_dib.h" |
28 #include "url/ipc/url_param_traits.h" | 28 #include "url/ipc/url_param_traits.h" |
29 #include "url/origin.h" | 29 #include "url/origin.h" |
30 | 30 |
31 #if defined(OS_WIN) | 31 #if defined(OS_WIN) |
32 #include "base/win/win_util.h" | 32 #include "base/win/win_util.h" |
33 #endif | 33 #endif |
34 | 34 |
35 namespace content { | 35 namespace content { |
| 36 class MessagePort; |
36 class PageState; | 37 class PageState; |
37 } | 38 } |
38 | 39 |
39 namespace net { | 40 namespace net { |
40 class HostPortPair; | 41 class HostPortPair; |
41 class IPAddress; | 42 class IPAddress; |
42 class IPEndPoint; | 43 class IPEndPoint; |
43 } | 44 } |
44 | 45 |
45 namespace IPC { | 46 namespace IPC { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 typedef net::IPAddress param_type; | 83 typedef net::IPAddress param_type; |
83 static void GetSize(base::PickleSizer* s, const param_type& p); | 84 static void GetSize(base::PickleSizer* s, const param_type& p); |
84 static void Write(base::Pickle* m, const param_type& p); | 85 static void Write(base::Pickle* m, const param_type& p); |
85 static bool Read(const base::Pickle* m, | 86 static bool Read(const base::Pickle* m, |
86 base::PickleIterator* iter, | 87 base::PickleIterator* iter, |
87 param_type* p); | 88 param_type* p); |
88 static void Log(const param_type& p, std::string* l); | 89 static void Log(const param_type& p, std::string* l); |
89 }; | 90 }; |
90 | 91 |
91 template <> | 92 template <> |
| 93 struct CONTENT_EXPORT ParamTraits<content::MessagePort> { |
| 94 typedef content::MessagePort param_type; |
| 95 static void GetSize(base::PickleSizer* sizer, const param_type& p); |
| 96 static void Write(base::Pickle* m, const param_type& p); |
| 97 static bool Read(const base::Pickle* m, base::PickleIterator* iter, |
| 98 param_type* r); |
| 99 static void Log(const param_type& p, std::string* l); |
| 100 }; |
| 101 |
| 102 template <> |
92 struct CONTENT_EXPORT ParamTraits<content::PageState> { | 103 struct CONTENT_EXPORT ParamTraits<content::PageState> { |
93 typedef content::PageState param_type; | 104 typedef content::PageState param_type; |
94 static void GetSize(base::PickleSizer* s, const param_type& p); | 105 static void GetSize(base::PickleSizer* s, const param_type& p); |
95 static void Write(base::Pickle* m, const param_type& p); | 106 static void Write(base::Pickle* m, const param_type& p); |
96 static bool Read(const base::Pickle* m, | 107 static bool Read(const base::Pickle* m, |
97 base::PickleIterator* iter, | 108 base::PickleIterator* iter, |
98 param_type* p); | 109 param_type* p); |
99 static void Log(const param_type& p, std::string* l); | 110 static void Log(const param_type& p, std::string* l); |
100 }; | 111 }; |
101 | 112 |
(...skipping 26 matching lines...) Expand all Loading... |
128 #endif | 139 #endif |
129 } | 140 } |
130 static void Log(const param_type& p, std::string* l) { | 141 static void Log(const param_type& p, std::string* l) { |
131 l->append("<gfx::NativeWindow>"); | 142 l->append("<gfx::NativeWindow>"); |
132 } | 143 } |
133 }; | 144 }; |
134 | 145 |
135 } // namespace IPC | 146 } // namespace IPC |
136 | 147 |
137 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ | 148 #endif // CONTENT_PUBLIC_COMMON_COMMON_PARAM_TRAITS_H_ |
OLD | NEW |