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 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 system_type != PP_FILESYSTEMTYPE_LOCALTEMPORARY) | 129 system_type != PP_FILESYSTEMTYPE_LOCALTEMPORARY) |
130 return false; | 130 return false; |
131 r->system_type = static_cast<PP_FileSystemType>(system_type); | 131 r->system_type = static_cast<PP_FileSystemType>(system_type); |
132 return true; | 132 return true; |
133 } | 133 } |
134 | 134 |
135 // static | 135 // static |
136 void ParamTraits<PP_FileInfo>::Log(const param_type& p, std::string* l) { | 136 void ParamTraits<PP_FileInfo>::Log(const param_type& p, std::string* l) { |
137 } | 137 } |
138 | 138 |
139 // PP_Flash_NetAddress --------------------------------------------------------- | 139 // PP_NetAddress_Private ------------------------------------------------------- |
140 | 140 |
141 // static | 141 // static |
142 void ParamTraits<PP_Flash_NetAddress>::Write(Message* m, const param_type& p) { | 142 void ParamTraits<PP_NetAddress_Private>::Write(Message* m, |
| 143 const param_type& p) { |
143 WriteParam(m, p.size); | 144 WriteParam(m, p.size); |
144 m->WriteBytes(p.data, static_cast<int>(p.size)); | 145 m->WriteBytes(p.data, static_cast<int>(p.size)); |
145 } | 146 } |
146 | 147 |
147 // static | 148 // static |
148 bool ParamTraits<PP_Flash_NetAddress>::Read(const Message* m, | 149 bool ParamTraits<PP_NetAddress_Private>::Read(const Message* m, |
149 void** iter, | 150 void** iter, |
150 param_type* p) { | 151 param_type* p) { |
151 uint16 size; | 152 uint16 size; |
152 if (!ReadParam(m, iter, &size)) | 153 if (!ReadParam(m, iter, &size)) |
153 return false; | 154 return false; |
154 if (size > sizeof(p->data)) | 155 if (size > sizeof(p->data)) |
155 return false; | 156 return false; |
156 p->size = size; | 157 p->size = size; |
157 | 158 |
158 const char* data; | 159 const char* data; |
159 if (!m->ReadBytes(iter, &data, size)) | 160 if (!m->ReadBytes(iter, &data, size)) |
160 return false; | 161 return false; |
161 memcpy(p->data, data, size); | 162 memcpy(p->data, data, size); |
162 return true; | 163 return true; |
163 } | 164 } |
164 | 165 |
165 // static | 166 // static |
166 void ParamTraits<PP_Flash_NetAddress>::Log(const param_type& p, | 167 void ParamTraits<PP_NetAddress_Private>::Log(const param_type& p, |
167 std::string* l) { | 168 std::string* l) { |
168 l->append("<PP_Flash_NetAddress ("); | 169 l->append("<PP_NetAddress_Private ("); |
169 LogParam(p.size, l); | 170 LogParam(p.size, l); |
170 l->append(" bytes)>"); | 171 l->append(" bytes)>"); |
171 } | 172 } |
172 | 173 |
173 // PP_ObjectProperty ----------------------------------------------------------- | 174 // PP_ObjectProperty ----------------------------------------------------------- |
174 | 175 |
175 // static | 176 // static |
176 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { | 177 void ParamTraits<PP_ObjectProperty>::Write(Message* m, const param_type& p) { |
177 // FIXME(brettw); | 178 // FIXME(brettw); |
178 } | 179 } |
(...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
474 param_type* r) { | 475 param_type* r) { |
475 return r->ReadFromMessage(m, iter); | 476 return r->ReadFromMessage(m, iter); |
476 } | 477 } |
477 | 478 |
478 // static | 479 // static |
479 void ParamTraits<ppapi::proxy::SerializedFlashMenu>::Log(const param_type& p, | 480 void ParamTraits<ppapi::proxy::SerializedFlashMenu>::Log(const param_type& p, |
480 std::string* l) { | 481 std::string* l) { |
481 } | 482 } |
482 | 483 |
483 } // namespace IPC | 484 } // namespace IPC |
OLD | NEW |