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 #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/file_path.h" | 17 #include "ppapi/shared_impl/file_path.h" |
18 #include "ppapi/shared_impl/file_ref_create_info.h" | 18 #include "ppapi/shared_impl/file_ref_create_info.h" |
19 #include "ppapi/shared_impl/ppapi_permissions.h" | 19 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 20 #include "ppapi/shared_impl/ppb_file_ref_shared.h" |
20 #include "ppapi/shared_impl/socket_option_data.h" | 21 #include "ppapi/shared_impl/socket_option_data.h" |
21 | 22 |
22 struct PP_FileInfo; | 23 struct PP_FileInfo; |
23 struct PP_NetAddress_Private; | 24 struct PP_NetAddress_Private; |
24 | 25 |
25 namespace ppapi { | 26 namespace ppapi { |
26 | 27 |
27 class HostResource; | 28 class HostResource; |
28 class PPB_X509Certificate_Fields; | 29 class PPB_X509Certificate_Fields; |
29 | 30 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 70 |
70 template<> | 71 template<> |
71 struct PPAPI_PROXY_EXPORT ParamTraits< | 72 struct PPAPI_PROXY_EXPORT ParamTraits< |
72 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { | 73 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { |
73 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; | 74 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; |
74 static void Write(Message* m, const param_type& p); | 75 static void Write(Message* m, const param_type& p); |
75 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 76 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
76 static void Log(const param_type& p, std::string* l); | 77 static void Log(const param_type& p, std::string* l); |
77 }; | 78 }; |
78 | 79 |
| 80 // TODO(teravest): Remove this when we've switched over to the new proxy. |
| 81 template<> |
| 82 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_FileRef_CreateInfo> { |
| 83 typedef ppapi::PPB_FileRef_CreateInfo param_type; |
| 84 static void Write(Message* m, const param_type& p); |
| 85 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 86 static void Log(const param_type& p, std::string* l); |
| 87 }; |
| 88 |
79 template<> | 89 template<> |
80 struct PPAPI_PROXY_EXPORT ParamTraits< | 90 struct PPAPI_PROXY_EXPORT ParamTraits< |
81 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { | 91 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { |
82 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; | 92 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
83 static void Write(Message* m, const param_type& p); | 93 static void Write(Message* m, const param_type& p); |
84 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 94 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
85 static void Log(const param_type& p, std::string* l); | 95 static void Log(const param_type& p, std::string* l); |
86 }; | 96 }; |
87 | 97 |
88 template<> | 98 template<> |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 template<> | 147 template<> |
138 struct PPAPI_PROXY_EXPORT ParamTraits< | 148 struct PPAPI_PROXY_EXPORT ParamTraits< |
139 std::vector<ppapi::proxy::SerializedVar> > { | 149 std::vector<ppapi::proxy::SerializedVar> > { |
140 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 150 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
141 static void Write(Message* m, const param_type& p); | 151 static void Write(Message* m, const param_type& p); |
142 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 152 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
143 static void Log(const param_type& p, std::string* l); | 153 static void Log(const param_type& p, std::string* l); |
144 }; | 154 }; |
145 | 155 |
146 template<> | 156 template<> |
| 157 struct PPAPI_PROXY_EXPORT ParamTraits< std::vector< |
| 158 ppapi::PPB_FileRef_CreateInfo> > { |
| 159 typedef std::vector<ppapi::PPB_FileRef_CreateInfo> param_type; |
| 160 static void Write(Message* m, const param_type& p); |
| 161 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
| 162 static void Log(const param_type& p, std::string* l); |
| 163 }; |
| 164 |
| 165 template<> |
147 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { | 166 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { |
148 typedef ppapi::PpapiPermissions param_type; | 167 typedef ppapi::PpapiPermissions param_type; |
149 static void Write(Message* m, const param_type& p); | 168 static void Write(Message* m, const param_type& p); |
150 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 169 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
151 static void Log(const param_type& p, std::string* l); | 170 static void Log(const param_type& p, std::string* l); |
152 }; | 171 }; |
153 | 172 |
154 #if !defined(OS_NACL) && !defined(NACL_WIN64) | 173 #if !defined(OS_NACL) && !defined(NACL_WIN64) |
155 template <> | 174 template <> |
156 struct ParamTraits<ppapi::PepperFilePath> { | 175 struct ParamTraits<ppapi::PepperFilePath> { |
(...skipping 24 matching lines...) Expand all Loading... |
181 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { | 200 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { |
182 typedef ppapi::SocketOptionData param_type; | 201 typedef ppapi::SocketOptionData param_type; |
183 static void Write(Message* m, const param_type& p); | 202 static void Write(Message* m, const param_type& p); |
184 static bool Read(const Message* m, PickleIterator* iter, param_type* r); | 203 static bool Read(const Message* m, PickleIterator* iter, param_type* r); |
185 static void Log(const param_type& p, std::string* l); | 204 static void Log(const param_type& p, std::string* l); |
186 }; | 205 }; |
187 | 206 |
188 } // namespace IPC | 207 } // namespace IPC |
189 | 208 |
190 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 209 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
OLD | NEW |