| 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 | 18 |
| 19 struct PP_FileInfo; | 19 struct PP_FileInfo; |
| 20 struct PP_HostResolver_Private_Hint; |
| 21 struct PP_NetAddress_Private; |
| 20 struct PP_ObjectProperty; | 22 struct PP_ObjectProperty; |
| 21 struct PP_NetAddress_Private; | |
| 22 | 23 |
| 23 namespace ppapi { | 24 namespace ppapi { |
| 24 | 25 |
| 25 class HostResource; | 26 class HostResource; |
| 27 class NetworkList; |
| 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; |
| 32 struct SerializedFontDescription; | 34 struct SerializedFontDescription; |
| 33 class SerializedFlashMenu; | 35 class SerializedFlashMenu; |
| 34 class SerializedVar; | 36 class SerializedVar; |
| 35 | 37 |
| (...skipping 11 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 122 |
| 113 template<> | 123 template<> |
| 114 struct ParamTraits<ppapi::HostResource> { | 124 struct ParamTraits<ppapi::HostResource> { |
| 115 typedef ppapi::HostResource param_type; | 125 typedef ppapi::HostResource param_type; |
| 116 static void Write(Message* m, const param_type& p); | 126 static void Write(Message* m, const param_type& p); |
| 117 static bool Read(const Message* m, void** iter, param_type* r); | 127 static bool Read(const Message* m, void** iter, param_type* r); |
| 118 static void Log(const param_type& p, std::string* l); | 128 static void Log(const param_type& p, std::string* l); |
| 119 }; | 129 }; |
| 120 | 130 |
| 121 template<> | 131 template<> |
| 132 struct ParamTraits<ppapi::NetworkList> { |
| 133 typedef ppapi::NetworkList param_type; |
| 134 static void Write(Message* m, const param_type& p); |
| 135 static bool Read(const Message* m, void** iter, param_type* r); |
| 136 static void Log(const param_type& p, std::string* l); |
| 137 }; |
| 138 |
| 139 template<> |
| 122 struct ParamTraits<ppapi::proxy::SerializedVar> { | 140 struct ParamTraits<ppapi::proxy::SerializedVar> { |
| 123 typedef ppapi::proxy::SerializedVar param_type; | 141 typedef ppapi::proxy::SerializedVar param_type; |
| 124 static void Write(Message* m, const param_type& p); | 142 static void Write(Message* m, const param_type& p); |
| 125 static bool Read(const Message* m, void** iter, param_type* r); | 143 static bool Read(const Message* m, void** iter, param_type* r); |
| 126 static void Log(const param_type& p, std::string* l); | 144 static void Log(const param_type& p, std::string* l); |
| 127 }; | 145 }; |
| 128 | 146 |
| 129 template<> | 147 template<> |
| 130 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { | 148 struct ParamTraits< std::vector<ppapi::proxy::SerializedVar> > { |
| 131 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 149 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
| (...skipping 14 matching lines...) Expand all Loading... |
| 146 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 164 struct ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
| 147 typedef ppapi::proxy::SerializedFlashMenu param_type; | 165 typedef ppapi::proxy::SerializedFlashMenu param_type; |
| 148 static void Write(Message* m, const param_type& p); | 166 static void Write(Message* m, const param_type& p); |
| 149 static bool Read(const Message* m, void** iter, param_type* r); | 167 static bool Read(const Message* m, void** iter, param_type* r); |
| 150 static void Log(const param_type& p, std::string* l); | 168 static void Log(const param_type& p, std::string* l); |
| 151 }; | 169 }; |
| 152 | 170 |
| 153 } // namespace IPC | 171 } // namespace IPC |
| 154 | 172 |
| 155 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 173 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |