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 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 5 #ifndef PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 6 #define PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "ipc/ipc_message_utils.h" | 11 #include "ipc/ipc_message_utils.h" |
12 #include "ipc/ipc_platform_file.h" | 12 #include "ipc/ipc_platform_file.h" |
13 #include "ppapi/c/pp_completion_callback.h" | 13 #include "ppapi/c/pp_completion_callback.h" |
14 #include "ppapi/c/pp_rect.h" | 14 #include "ppapi/c/pp_rect.h" |
15 #include "ppapi/c/pp_var.h" | 15 #include "ppapi/c/pp_var.h" |
16 #include "ppapi/proxy/ppapi_proxy_export.h" | 16 #include "ppapi/proxy/ppapi_proxy_export.h" |
17 #include "ppapi/shared_impl/ppb_file_ref_shared.h" | 17 #include "ppapi/shared_impl/ppb_file_ref_shared.h" |
| 18 #include "ppapi/shared_impl/private/ppb_host_resolver_shared.h" |
18 | 19 |
19 struct PP_FileInfo; | 20 struct PP_FileInfo; |
| 21 struct PP_HostResolver_Private_Hint; |
| 22 struct PP_NetAddress_Private; |
20 struct PP_ObjectProperty; | 23 struct PP_ObjectProperty; |
21 struct PP_NetAddress_Private; | |
22 | 24 |
23 namespace ppapi { | 25 namespace ppapi { |
24 | 26 |
25 class HostResource; | 27 class HostResource; |
26 | 28 |
27 namespace proxy { | 29 namespace proxy { |
28 | 30 |
29 struct PPBFlash_DrawGlyphs_Params; | 31 struct PPBFlash_DrawGlyphs_Params; |
30 struct PPBURLLoader_UpdateProgress_Params; | 32 struct PPBURLLoader_UpdateProgress_Params; |
31 struct SerializedDirEntry; | 33 struct SerializedDirEntry; |
(...skipping 15 matching lines...) Expand all Loading... |
47 }; | 49 }; |
48 | 50 |
49 template<> | 51 template<> |
50 struct ParamTraits<PP_FileInfo> { | 52 struct ParamTraits<PP_FileInfo> { |
51 typedef PP_FileInfo param_type; | 53 typedef PP_FileInfo param_type; |
52 static void Write(Message* m, const param_type& p); | 54 static void Write(Message* m, const param_type& p); |
53 static bool Read(const Message* m, void** iter, param_type* r); | 55 static bool Read(const Message* m, void** iter, param_type* r); |
54 static void Log(const param_type& p, std::string* l); | 56 static void Log(const param_type& p, std::string* l); |
55 }; | 57 }; |
56 | 58 |
| 59 template<> |
| 60 struct ParamTraits<PP_HostResolver_Private_Hint> { |
| 61 typedef PP_HostResolver_Private_Hint param_type; |
| 62 static void Write(Message* m, const param_type& p); |
| 63 static bool Read(const Message* m, void** iter, param_type* r); |
| 64 static void Log(const param_type& p, std::string* l); |
| 65 }; |
| 66 |
57 template <> | 67 template <> |
58 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { | 68 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { |
59 typedef PP_NetAddress_Private param_type; | 69 typedef PP_NetAddress_Private param_type; |
60 static void Write(Message* m, const param_type& p); | 70 static void Write(Message* m, const param_type& p); |
61 static bool Read(const Message* m, void** iter, param_type* p); | 71 static bool Read(const Message* m, void** iter, param_type* p); |
62 static void Log(const param_type& p, std::string* l); | 72 static void Log(const param_type& p, std::string* l); |
63 }; | 73 }; |
64 | 74 |
65 template<> | 75 template<> |
66 struct ParamTraits<PP_ObjectProperty> { | 76 struct ParamTraits<PP_ObjectProperty> { |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 114 |
105 template<> | 115 template<> |
106 struct ParamTraits<ppapi::proxy::SerializedFontDescription> { | 116 struct ParamTraits<ppapi::proxy::SerializedFontDescription> { |
107 typedef ppapi::proxy::SerializedFontDescription param_type; | 117 typedef ppapi::proxy::SerializedFontDescription param_type; |
108 static void Write(Message* m, const param_type& p); | 118 static void Write(Message* m, const param_type& p); |
109 static bool Read(const Message* m, void** iter, param_type* r); | 119 static bool Read(const Message* m, void** iter, param_type* r); |
110 static void Log(const param_type& p, std::string* l); | 120 static void Log(const param_type& p, std::string* l); |
111 }; | 121 }; |
112 | 122 |
113 template<> | 123 template<> |
| 124 struct ParamTraits<ppapi::HostPortPair> { |
| 125 typedef ppapi::HostPortPair param_type; |
| 126 static void Write(Message* m, const param_type& p); |
| 127 static bool Read(const Message* m, void** iter, param_type* r); |
| 128 static void Log(const param_type& p, std::string* l); |
| 129 }; |
| 130 |
| 131 template<> |
114 struct ParamTraits<ppapi::HostResource> { | 132 struct ParamTraits<ppapi::HostResource> { |
115 typedef ppapi::HostResource param_type; | 133 typedef ppapi::HostResource param_type; |
116 static void Write(Message* m, const param_type& p); | 134 static void Write(Message* m, const param_type& p); |
117 static bool Read(const Message* m, void** iter, param_type* r); | 135 static bool Read(const Message* m, void** iter, param_type* r); |
118 static void Log(const param_type& p, std::string* l); | 136 static void Log(const param_type& p, std::string* l); |
119 }; | 137 }; |
120 | 138 |
121 template<> | 139 template<> |
| 140 struct ParamTraits<ppapi::NameAndAddressPair> { |
| 141 typedef ppapi::NameAndAddressPair param_type; |
| 142 static void Write(Message* m, const param_type& p); |
| 143 static bool Read(const Message* m, void** iter, param_type* r); |
| 144 static void Log(const param_type& p, std::string* l); |
| 145 }; |
| 146 |
| 147 template<> |
| 148 struct ParamTraits<ppapi::NetworkList> { |
| 149 typedef ppapi::NetworkList param_type; |
| 150 static void Write(Message* m, const param_type& p); |
| 151 static bool Read(const Message* m, void** iter, param_type* r); |
| 152 static void Log(const param_type& p, std::string* l); |
| 153 }; |
| 154 |
| 155 template<> |
122 struct ParamTraits<ppapi::proxy::SerializedVar> { | 156 struct ParamTraits<ppapi::proxy::SerializedVar> { |
123 typedef ppapi::proxy::SerializedVar param_type; | 157 typedef ppapi::proxy::SerializedVar param_type; |
124 static void Write(Message* m, const param_type& p); | 158 static void Write(Message* m, const param_type& p); |
125 static bool Read(const Message* m, void** iter, param_type* r); | 159 static bool Read(const Message* m, void** iter, param_type* r); |
126 static void Log(const param_type& p, std::string* l); | 160 static void Log(const param_type& p, std::string* l); |
127 }; | 161 }; |
128 | 162 |
129 template<> | 163 template<> |
130 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { | 164 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { |
131 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 165 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
(...skipping 14 matching lines...) Expand all Loading... |
146 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 180 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
147 typedef ppapi::proxy::SerializedFlashMenu param_type; | 181 typedef ppapi::proxy::SerializedFlashMenu param_type; |
148 static void Write(Message* m, const param_type& p); | 182 static void Write(Message* m, const param_type& p); |
149 static bool Read(const Message* m, void** iter, param_type* r); | 183 static bool Read(const Message* m, void** iter, param_type* r); |
150 static void Log(const param_type& p, std::string* l); | 184 static void Log(const param_type& p, std::string* l); |
151 }; | 185 }; |
152 | 186 |
153 } // namespace IPC | 187 } // namespace IPC |
154 | 188 |
155 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 189 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
OLD | NEW |