| 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 |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 class SerializedVar; | 42 class SerializedVar; |
| 43 | 43 |
| 44 } // namespace proxy | 44 } // namespace proxy |
| 45 } // namespace ppapi | 45 } // namespace ppapi |
| 46 | 46 |
| 47 namespace IPC { | 47 namespace IPC { |
| 48 | 48 |
| 49 template<> | 49 template<> |
| 50 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> { | 50 struct PPAPI_PROXY_EXPORT ParamTraits<PP_Bool> { |
| 51 typedef PP_Bool param_type; | 51 typedef PP_Bool param_type; |
| 52 static void Write(Message* m, const param_type& p); | 52 static void Write(base::Pickle* m, const param_type& p); |
| 53 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 53 static bool Read(const base::Pickle* m, |
| 54 base::PickleIterator* iter, |
| 55 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 |
| 57 template <> | 59 template <> |
| 58 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { | 60 struct PPAPI_PROXY_EXPORT ParamTraits<PP_NetAddress_Private> { |
| 59 typedef PP_NetAddress_Private param_type; | 61 typedef PP_NetAddress_Private param_type; |
| 60 static void Write(Message* m, const param_type& p); | 62 static void Write(base::Pickle* m, const param_type& p); |
| 61 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); | 63 static bool Read(const base::Pickle* m, |
| 64 base::PickleIterator* iter, |
| 65 param_type* p); |
| 62 static void Log(const param_type& p, std::string* l); | 66 static void Log(const param_type& p, std::string* l); |
| 63 }; | 67 }; |
| 64 | 68 |
| 65 template <> | 69 template <> |
| 66 struct PPAPI_PROXY_EXPORT ParamTraits<PP_KeyInformation> { | 70 struct PPAPI_PROXY_EXPORT ParamTraits<PP_KeyInformation> { |
| 67 typedef PP_KeyInformation param_type; | 71 typedef PP_KeyInformation param_type; |
| 68 static void Write(Message* m, const param_type& p); | 72 static void Write(base::Pickle* m, const param_type& p); |
| 69 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); | 73 static bool Read(const base::Pickle* m, |
| 74 base::PickleIterator* iter, |
| 75 param_type* p); |
| 70 static void Log(const param_type& p, std::string* l); | 76 static void Log(const param_type& p, std::string* l); |
| 71 }; | 77 }; |
| 72 | 78 |
| 73 template<> | 79 template<> |
| 74 struct PPAPI_PROXY_EXPORT ParamTraits< | 80 struct PPAPI_PROXY_EXPORT ParamTraits< |
| 75 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { | 81 ppapi::proxy::PPBFlash_DrawGlyphs_Params> { |
| 76 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; | 82 typedef ppapi::proxy::PPBFlash_DrawGlyphs_Params param_type; |
| 77 static void Write(Message* m, const param_type& p); | 83 static void Write(base::Pickle* m, const param_type& p); |
| 78 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 84 static bool Read(const base::Pickle* m, |
| 85 base::PickleIterator* iter, |
| 86 param_type* r); |
| 79 static void Log(const param_type& p, std::string* l); | 87 static void Log(const param_type& p, std::string* l); |
| 80 }; | 88 }; |
| 81 | 89 |
| 82 template<> | 90 template<> |
| 83 struct PPAPI_PROXY_EXPORT ParamTraits< | 91 struct PPAPI_PROXY_EXPORT ParamTraits< |
| 84 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { | 92 ppapi::proxy::PPBURLLoader_UpdateProgress_Params> { |
| 85 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; | 93 typedef ppapi::proxy::PPBURLLoader_UpdateProgress_Params param_type; |
| 86 static void Write(Message* m, const param_type& p); | 94 static void Write(base::Pickle* m, const param_type& p); |
| 87 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 95 static bool Read(const base::Pickle* m, |
| 96 base::PickleIterator* iter, |
| 97 param_type* r); |
| 88 static void Log(const param_type& p, std::string* l); | 98 static void Log(const param_type& p, std::string* l); |
| 89 }; | 99 }; |
| 90 | 100 |
| 91 template<> | 101 template<> |
| 92 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> { | 102 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedDirEntry> { |
| 93 typedef ppapi::proxy::SerializedDirEntry param_type; | 103 typedef ppapi::proxy::SerializedDirEntry param_type; |
| 94 static void Write(Message* m, const param_type& p); | 104 static void Write(base::Pickle* m, const param_type& p); |
| 95 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 105 static bool Read(const base::Pickle* m, |
| 106 base::PickleIterator* iter, |
| 107 param_type* r); |
| 96 static void Log(const param_type& p, std::string* l); | 108 static void Log(const param_type& p, std::string* l); |
| 97 }; | 109 }; |
| 98 | 110 |
| 99 template<> | 111 template<> |
| 100 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> { | 112 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFontDescription> { |
| 101 typedef ppapi::proxy::SerializedFontDescription param_type; | 113 typedef ppapi::proxy::SerializedFontDescription param_type; |
| 102 static void Write(Message* m, const param_type& p); | 114 static void Write(base::Pickle* m, const param_type& p); |
| 103 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 115 static bool Read(const base::Pickle* m, |
| 116 base::PickleIterator* iter, |
| 117 param_type* r); |
| 104 static void Log(const param_type& p, std::string* l); | 118 static void Log(const param_type& p, std::string* l); |
| 105 }; | 119 }; |
| 106 | 120 |
| 107 template<> | 121 template<> |
| 108 struct PPAPI_PROXY_EXPORT | 122 struct PPAPI_PROXY_EXPORT |
| 109 ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc> { | 123 ParamTraits<ppapi::proxy::SerializedTrueTypeFontDesc> { |
| 110 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type; | 124 typedef ppapi::proxy::SerializedTrueTypeFontDesc param_type; |
| 111 static void Write(Message* m, const param_type& p); | 125 static void Write(base::Pickle* m, const param_type& p); |
| 112 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 126 static bool Read(const base::Pickle* m, |
| 127 base::PickleIterator* iter, |
| 128 param_type* r); |
| 113 static void Log(const param_type& p, std::string* l); | 129 static void Log(const param_type& p, std::string* l); |
| 114 }; | 130 }; |
| 115 | 131 |
| 116 template<> | 132 template<> |
| 117 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> { | 133 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedHandle> { |
| 118 typedef ppapi::proxy::SerializedHandle param_type; | 134 typedef ppapi::proxy::SerializedHandle param_type; |
| 119 static void Write(Message* m, const param_type& p); | 135 static void Write(base::Pickle* m, const param_type& p); |
| 120 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 136 static bool Read(const base::Pickle* m, |
| 137 base::PickleIterator* iter, |
| 138 param_type* r); |
| 121 static void Log(const param_type& p, std::string* l); | 139 static void Log(const param_type& p, std::string* l); |
| 122 }; | 140 }; |
| 123 | 141 |
| 124 template<> | 142 template<> |
| 125 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> { | 143 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::HostResource> { |
| 126 typedef ppapi::HostResource param_type; | 144 typedef ppapi::HostResource param_type; |
| 127 static void Write(Message* m, const param_type& p); | 145 static void Write(base::Pickle* m, const param_type& p); |
| 128 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 146 static bool Read(const base::Pickle* m, |
| 147 base::PickleIterator* iter, |
| 148 param_type* r); |
| 129 static void Log(const param_type& p, std::string* l); | 149 static void Log(const param_type& p, std::string* l); |
| 130 }; | 150 }; |
| 131 | 151 |
| 132 template<> | 152 template<> |
| 133 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> { | 153 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedVar> { |
| 134 typedef ppapi::proxy::SerializedVar param_type; | 154 typedef ppapi::proxy::SerializedVar param_type; |
| 135 static void Write(Message* m, const param_type& p); | 155 static void Write(base::Pickle* m, const param_type& p); |
| 136 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 156 static bool Read(const base::Pickle* m, |
| 157 base::PickleIterator* iter, |
| 158 param_type* r); |
| 137 static void Log(const param_type& p, std::string* l); | 159 static void Log(const param_type& p, std::string* l); |
| 138 }; | 160 }; |
| 139 | 161 |
| 140 template<> | 162 template<> |
| 141 struct PPAPI_PROXY_EXPORT ParamTraits< | 163 struct PPAPI_PROXY_EXPORT ParamTraits< |
| 142 std::vector<ppapi::proxy::SerializedVar> > { | 164 std::vector<ppapi::proxy::SerializedVar> > { |
| 143 typedef std::vector<ppapi::proxy::SerializedVar> param_type; | 165 typedef std::vector<ppapi::proxy::SerializedVar> param_type; |
| 144 static void Write(Message* m, const param_type& p); | 166 static void Write(base::Pickle* m, const param_type& p); |
| 145 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 167 static bool Read(const base::Pickle* m, |
| 168 base::PickleIterator* iter, |
| 169 param_type* r); |
| 146 static void Log(const param_type& p, std::string* l); | 170 static void Log(const param_type& p, std::string* l); |
| 147 }; | 171 }; |
| 148 | 172 |
| 149 template<> | 173 template<> |
| 150 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { | 174 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PpapiPermissions> { |
| 151 typedef ppapi::PpapiPermissions param_type; | 175 typedef ppapi::PpapiPermissions param_type; |
| 152 static void Write(Message* m, const param_type& p); | 176 static void Write(base::Pickle* m, const param_type& p); |
| 153 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 177 static bool Read(const base::Pickle* m, |
| 178 base::PickleIterator* iter, |
| 179 param_type* r); |
| 154 static void Log(const param_type& p, std::string* l); | 180 static void Log(const param_type& p, std::string* l); |
| 155 }; | 181 }; |
| 156 | 182 |
| 157 #if !defined(OS_NACL) && !defined(NACL_WIN64) | 183 #if !defined(OS_NACL) && !defined(NACL_WIN64) |
| 158 template <> | 184 template <> |
| 159 struct ParamTraits<ppapi::PepperFilePath> { | 185 struct ParamTraits<ppapi::PepperFilePath> { |
| 160 typedef ppapi::PepperFilePath param_type; | 186 typedef ppapi::PepperFilePath param_type; |
| 161 static void Write(Message* m, const param_type& p); | 187 static void Write(base::Pickle* m, const param_type& p); |
| 162 static bool Read(const Message* m, base::PickleIterator* iter, param_type* p); | 188 static bool Read(const base::Pickle* m, |
| 189 base::PickleIterator* iter, |
| 190 param_type* p); |
| 163 static void Log(const param_type& p, std::string* l); | 191 static void Log(const param_type& p, std::string* l); |
| 164 }; | 192 }; |
| 165 | 193 |
| 166 template<> | 194 template<> |
| 167 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { | 195 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::proxy::SerializedFlashMenu> { |
| 168 typedef ppapi::proxy::SerializedFlashMenu param_type; | 196 typedef ppapi::proxy::SerializedFlashMenu param_type; |
| 169 static void Write(Message* m, const param_type& p); | 197 static void Write(base::Pickle* m, const param_type& p); |
| 170 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 198 static bool Read(const base::Pickle* m, |
| 199 base::PickleIterator* iter, |
| 200 param_type* r); |
| 171 static void Log(const param_type& p, std::string* l); | 201 static void Log(const param_type& p, std::string* l); |
| 172 }; | 202 }; |
| 173 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) | 203 #endif // !defined(OS_NACL) && !defined(NACL_WIN64) |
| 174 | 204 |
| 175 template<> | 205 template<> |
| 176 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> { | 206 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::PPB_X509Certificate_Fields> { |
| 177 typedef ppapi::PPB_X509Certificate_Fields param_type; | 207 typedef ppapi::PPB_X509Certificate_Fields param_type; |
| 178 static void Write(Message* m, const param_type& p); | 208 static void Write(base::Pickle* m, const param_type& p); |
| 179 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 209 static bool Read(const base::Pickle* m, |
| 210 base::PickleIterator* iter, |
| 211 param_type* r); |
| 180 static void Log(const param_type& p, std::string* l); | 212 static void Log(const param_type& p, std::string* l); |
| 181 }; | 213 }; |
| 182 | 214 |
| 183 template<> | 215 template<> |
| 184 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { | 216 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::SocketOptionData> { |
| 185 typedef ppapi::SocketOptionData param_type; | 217 typedef ppapi::SocketOptionData param_type; |
| 186 static void Write(Message* m, const param_type& p); | 218 static void Write(base::Pickle* m, const param_type& p); |
| 187 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 219 static bool Read(const base::Pickle* m, |
| 220 base::PickleIterator* iter, |
| 221 param_type* r); |
| 188 static void Log(const param_type& p, std::string* l); | 222 static void Log(const param_type& p, std::string* l); |
| 189 }; | 223 }; |
| 190 | 224 |
| 191 template<> | 225 template<> |
| 192 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::CompositorLayerData::Transform> { | 226 struct PPAPI_PROXY_EXPORT ParamTraits<ppapi::CompositorLayerData::Transform> { |
| 193 typedef ppapi::CompositorLayerData::Transform param_type; | 227 typedef ppapi::CompositorLayerData::Transform param_type; |
| 194 static void Write(Message* m, const param_type& p); | 228 static void Write(base::Pickle* m, const param_type& p); |
| 195 static bool Read(const Message* m, base::PickleIterator* iter, param_type* r); | 229 static bool Read(const base::Pickle* m, |
| 230 base::PickleIterator* iter, |
| 231 param_type* r); |
| 196 static void Log(const param_type& p, std::string* l); | 232 static void Log(const param_type& p, std::string* l); |
| 197 }; | 233 }; |
| 198 | 234 |
| 199 } // namespace IPC | 235 } // namespace IPC |
| 200 | 236 |
| 201 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ | 237 #endif // PPAPI_PROXY_PPAPI_PARAM_TRAITS_H_ |
| OLD | NEW |