| 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/file_ref_impl.h" | 17 #include "ppapi/shared_impl/file_ref_impl.h" |
| 18 | 18 |
| 19 struct PP_FileInfo; | 19 struct PP_FileInfo; |
| 20 struct PP_ObjectProperty; | 20 struct PP_ObjectProperty; |
| 21 struct PP_Flash_Menu; | 21 struct PP_Flash_Menu; |
| 22 struct PP_Flash_NetAddress; | 22 struct PP_Flash_NetAddress; |
| 23 struct PP_NetAddress; |
| 23 | 24 |
| 24 namespace ppapi { | 25 namespace ppapi { |
| 25 | 26 |
| 26 class HostResource; | 27 class HostResource; |
| 27 //struct PPB_FileRef_CreateInfo; | 28 //struct PPB_FileRef_CreateInfo; |
| 28 | 29 |
| 29 namespace proxy { | 30 namespace proxy { |
| 30 | 31 |
| 31 struct PPBFlash_DrawGlyphs_Params; | 32 struct PPBFlash_DrawGlyphs_Params; |
| 32 struct PPBURLLoader_UpdateProgress_Params; | 33 struct PPBURLLoader_UpdateProgress_Params; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 50 | 51 |
| 51 template<> | 52 template<> |
| 52 struct ParamTraits<PP_FileInfo> { | 53 struct ParamTraits<PP_FileInfo> { |
| 53 typedef PP_FileInfo param_type; | 54 typedef PP_FileInfo param_type; |
| 54 static void Write(Message* m, const param_type& p); | 55 static void Write(Message* m, const param_type& p); |
| 55 static bool Read(const Message* m, void** iter, param_type* r); | 56 static bool Read(const Message* m, void** iter, param_type* r); |
| 56 static void Log(const param_type& p, std::string* l); | 57 static void Log(const param_type& p, std::string* l); |
| 57 }; | 58 }; |
| 58 | 59 |
| 59 template <> | 60 template <> |
| 61 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress> { |
| 62 typedef PP_NetAddress param_type; |
| 63 static void Write(Message* m, const param_type& p); |
| 64 static bool Read(const Message* m, void** iter, param_type* p); |
| 65 static void Log(const param_type& p, std::string* l); |
| 66 }; |
| 67 |
| 68 // TODO(dpolukhin): Replace all references to PP_Flash_NetAddress |
| 69 // with PP_NetAddress they are identical. |
| 70 template <> |
| 60 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Flash_NetAddress> { | 71 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Flash_NetAddress> { |
| 61 typedef PP_Flash_NetAddress param_type; | 72 typedef PP_Flash_NetAddress param_type; |
| 62 static void Write(Message* m, const param_type& p); | 73 static void Write(Message* m, const param_type& p); |
| 63 static bool Read(const Message* m, void** iter, param_type* p); | 74 static bool Read(const Message* m, void** iter, param_type* p); |
| 64 static void Log(const param_type& p, std::string* l); | 75 static void Log(const param_type& p, std::string* l); |
| 65 }; | 76 }; |
| 66 | 77 |
| 67 template<> | 78 template<> |
| 68 struct ParamTraits<PP_ObjectProperty> { | 79 struct ParamTraits<PP_ObjectProperty> { |
| 69 typedef PP_ObjectProperty param_type; | 80 typedef PP_ObjectProperty param_type; |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 159 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
| 149 typedef ppapi::proxy::SerializedFlashMenu param_type; | 160 typedef ppapi::proxy::SerializedFlashMenu param_type; |
| 150 static void Write(Message* m, const param_type& p); | 161 static void Write(Message* m, const param_type& p); |
| 151 static bool Read(const Message* m, void** iter, param_type* r); | 162 static bool Read(const Message* m, void** iter, param_type* r); |
| 152 static void Log(const param_type& p, std::string* l); | 163 static void Log(const param_type& p, std::string* l); |
| 153 }; | 164 }; |
| 154 | 165 |
| 155 } // namespace IPC | 166 } // namespace IPC |
| 156 | 167 |
| 157 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 168 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |