| 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 #include "ppapi/proxy/ppapi_param_traits.h" | 5 #include "ppapi/proxy/ppapi_param_traits.h" |
| 6 | 6 |
| 7 #include <string.h> // For memcpy | 7 #include <string.h> // For memcpy |
| 8 | 8 |
| 9 #include "ppapi/c/pp_file_info.h" | 9 #include "ppapi/c/pp_file_info.h" |
| 10 #include "ppapi/c/pp_resource.h" | 10 #include "ppapi/c/pp_resource.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 } | 164 } |
| 165 | 165 |
| 166 // static | 166 // static |
| 167 void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p, | 167 void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p, |
| 168 std::string* l) { | 168 std::string* l) { |
| 169 l->append("<PP_Flash_NetAddress ("); | 169 l->append("<PP_Flash_NetAddress ("); |
| 170 LogParam(p.size, l); | 170 LogParam(p.size, l); |
| 171 l->append(" bytes)>"); | 171 l->append(" bytes)>"); |
| 172 } | 172 } |
| 173 | 173 |
| 174 // PP_InputEvent --------------------------------------------------------------- | |
| 175 | |
| 176 // static | |
| 177 void ParamTraits<PP_InputEvent>::Write(Message* m, const param_type& p) { | |
| 178 // PP_InputEvent is just POD so we can just memcpy it. | |
| 179 m->WriteData(reinterpret_cast<const char*>(&p), sizeof(PP_InputEvent)); | |
| 180 } | |
| 181 | |
| 182 // static | |
| 183 bool ParamTraits<PP_InputEvent>::Read(const Message* m, | |
| 184 void** iter, | |
| 185 param_type* r) { | |
| 186 const char* data; | |
| 187 int data_size; | |
| 188 if (!m->ReadData(iter, &data, &data_size)) | |
| 189 return false; | |
| 190 memcpy(r, data, sizeof(PP_InputEvent)); | |
| 191 return true; | |
| 192 } | |
| 193 | |
| 194 // static | |
| 195 void ParamTraits<PP_InputEvent>::Log(const param_type& p, std::string* l) { | |
| 196 } | |
| 197 | |
| 198 // PP_ObjectProperty ----------------------------------------------------------- | 174 // PP_ObjectProperty ----------------------------------------------------------- |
| 199 | 175 |
| 200 // static | 176 // static |
| 201 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { | 177 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { |
| 202 // FIXME(brettw); | 178 // FIXME(brettw); |
| 203 } | 179 } |
| 204 | 180 |
| 205 // static | 181 // static |
| 206 bool ParamTraits<PP_ObjectProperty>::Read(const Message* m, | 182 bool ParamTraits<PP_ObjectProperty>::Read(const Message* m, |
| 207 void** iter, | 183 void** iter, |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 param_type* r) { | 477 param_type* r) { |
| 502 return r->ReadFromMessage(m, iter); | 478 return r->ReadFromMessage(m, iter); |
| 503 } | 479 } |
| 504 | 480 |
| 505 // static | 481 // static |
| 506 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p, | 482 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p, |
| 507 std::string* l) { | 483 std::string* l) { |
| 508 } | 484 } |
| 509 | 485 |
| 510 } // namespace IPC | 486 } // namespace IPC |
| OLD | NEW |