OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 // This file is used to define IPC::ParamTraits<> specializations for a number | 5 // This file is used to define IPC::ParamTraits<> specializations for a number |
6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> | 6 // of types so that they can be serialized over IPC. IPC::ParamTraits<> |
7 // specializations for basic types (like int and std::string) and types in the | 7 // specializations for basic types (like int and std::string) and types in the |
8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains | 8 // 'base' project can be found in ipc/ipc_message_utils.h. This file contains |
9 // specializations for types that are shared by more than one child process. | 9 // specializations for types that are shared by more than one child process. |
10 | 10 |
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 } | 275 } |
276 static bool Read(const Message* m, void** iter, param_type* r) { | 276 static bool Read(const Message* m, void** iter, param_type* r) { |
277 bool has_object; | 277 bool has_object; |
278 if (!ReadParam(m, iter, &has_object)) | 278 if (!ReadParam(m, iter, &has_object)) |
279 return false; | 279 return false; |
280 if (!has_object) | 280 if (!has_object) |
281 return true; | 281 return true; |
282 std::vector<net::UploadData::Element> elements; | 282 std::vector<net::UploadData::Element> elements; |
283 if (!ReadParam(m, iter, &elements)) | 283 if (!ReadParam(m, iter, &elements)) |
284 return false; | 284 return false; |
285 int identifier; | 285 int64 identifier; |
286 if (!ReadParam(m, iter, &identifier)) | 286 if (!ReadParam(m, iter, &identifier)) |
287 return false; | 287 return false; |
288 *r = new net::UploadData; | 288 *r = new net::UploadData; |
289 (*r)->swap_elements(&elements); | 289 (*r)->swap_elements(&elements); |
290 (*r)->set_identifier(identifier); | 290 (*r)->set_identifier(identifier); |
291 return true; | 291 return true; |
292 } | 292 } |
293 static void Log(const param_type& p, std::wstring* l) { | 293 static void Log(const param_type& p, std::wstring* l) { |
294 l->append(L"<net::UploadData>"); | 294 l->append(L"<net::UploadData>"); |
295 } | 295 } |
(...skipping 26 matching lines...) Expand all Loading... |
322 } | 322 } |
323 static void Log(const param_type& p, std::wstring* l) { | 323 static void Log(const param_type& p, std::wstring* l) { |
324 l->append(StringPrintf(L"(%f, %d, %d)", | 324 l->append(StringPrintf(L"(%f, %d, %d)", |
325 p.boring_score, p.good_clipping, p.at_top)); | 325 p.boring_score, p.good_clipping, p.at_top)); |
326 } | 326 } |
327 }; | 327 }; |
328 | 328 |
329 } // namespace IPC | 329 } // namespace IPC |
330 | 330 |
331 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ | 331 #endif // CHROME_COMMON_COMMON_PARAM_TRAITS_H_ |
OLD | NEW |