| 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 #include "ipc/ipc_message_utils.h" | 5 #include "ipc/ipc_message_utils.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/strings/nullable_string16.h" | 10 #include "base/strings/nullable_string16.h" |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 438 } | 438 } |
| 439 | 439 |
| 440 void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { | 440 void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { |
| 441 for (size_t i = 0; i < p.size(); ++i) { | 441 for (size_t i = 0; i < p.size(); ++i) { |
| 442 if (i != 0) | 442 if (i != 0) |
| 443 l->push_back(' '); | 443 l->push_back(' '); |
| 444 LogParam(static_cast<bool>(p[i]), l); | 444 LogParam(static_cast<bool>(p[i]), l); |
| 445 } | 445 } |
| 446 } | 446 } |
| 447 | 447 |
| 448 void ParamTraits<IPC::BrokerableAttachment::AttachmentId>::Write( |
| 449 Message* m, |
| 450 const param_type& p) { |
| 451 for (int i = 0; i < 4; ++i) { |
| 452 m->WriteUInt32(p.nonce[i]); |
| 453 } |
| 454 } |
| 455 |
| 456 bool ParamTraits<IPC::BrokerableAttachment::AttachmentId>::Read( |
| 457 const Message* m, |
| 458 base::PickleIterator* iter, |
| 459 param_type* r) { |
| 460 for (int i = 0; i < 4; ++i) { |
| 461 uint32_t temp; |
| 462 if (!iter->ReadUInt32(&temp)) |
| 463 return false; |
| 464 r->nonce[i] = temp; |
| 465 } |
| 466 return true; |
| 467 } |
| 468 |
| 469 void ParamTraits<IPC::BrokerableAttachment::AttachmentId>::Log( |
| 470 const param_type& p, |
| 471 std::string* l) { |
| 472 for (int i = 0; i < 4; ++i) { |
| 473 l->append(base::UintToString(p.nonce[i])); |
| 474 } |
| 475 } |
| 476 |
| 448 void ParamTraits<base::DictionaryValue>::Write(Message* m, | 477 void ParamTraits<base::DictionaryValue>::Write(Message* m, |
| 449 const param_type& p) { | 478 const param_type& p) { |
| 450 WriteValue(m, &p, 0); | 479 WriteValue(m, &p, 0); |
| 451 } | 480 } |
| 452 | 481 |
| 453 bool ParamTraits<base::DictionaryValue>::Read(const Message* m, | 482 bool ParamTraits<base::DictionaryValue>::Read(const Message* m, |
| 454 base::PickleIterator* iter, | 483 base::PickleIterator* iter, |
| 455 param_type* r) { | 484 param_type* r) { |
| 456 int type; | 485 int type; |
| 457 if (!ReadParam(m, iter, &type) || type != base::Value::TYPE_DICTIONARY) | 486 if (!ReadParam(m, iter, &type) || type != base::Value::TYPE_DICTIONARY) |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 866 return result; | 895 return result; |
| 867 } | 896 } |
| 868 | 897 |
| 869 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 898 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 870 l->append("<MSG>"); | 899 l->append("<MSG>"); |
| 871 } | 900 } |
| 872 | 901 |
| 873 #endif // OS_WIN | 902 #endif // OS_WIN |
| 874 | 903 |
| 875 } // namespace IPC | 904 } // namespace IPC |
| OLD | NEW |