| 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 |
| 174 // PP_ObjectProperty ----------------------------------------------------------- | 198 // PP_ObjectProperty ----------------------------------------------------------- |
| 175 | 199 |
| 176 // static | 200 // static |
| 177 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { | 201 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { |
| 178 // FIXME(brettw); | 202 // FIXME(brettw); |
| 179 } | 203 } |
| 180 | 204 |
| 181 // static | 205 // static |
| 182 bool ParamTraits<PP_ObjectProperty>::Read(const Message* m, | 206 bool ParamTraits<PP_ObjectProperty>::Read(const Message* m, |
| 183 void** iter, | 207 void** iter, |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 param_type* r) { | 501 param_type* r) { |
| 478 return r->ReadFromMessage(m, iter); | 502 return r->ReadFromMessage(m, iter); |
| 479 } | 503 } |
| 480 | 504 |
| 481 // static | 505 // static |
| 482 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p, | 506 void ParamTraits<pp::proxy::SerializedFlashMenu>::Log(const param_type& p, |
| 483 std::string* l) { | 507 std::string* l) { |
| 484 } | 508 } |
| 485 | 509 |
| 486 } // namespace IPC | 510 } // namespace IPC |
| OLD | NEW |