| 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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 445 for (size_t i = 0; i < p.size(); ++i) { | 445 for (size_t i = 0; i < p.size(); ++i) { |
| 446 if (i != 0) | 446 if (i != 0) |
| 447 l->push_back(' '); | 447 l->push_back(' '); |
| 448 LogParam(static_cast<bool>(p[i]), l); | 448 LogParam(static_cast<bool>(p[i]), l); |
| 449 } | 449 } |
| 450 } | 450 } |
| 451 | 451 |
| 452 void ParamTraits<BrokerableAttachment::AttachmentId>::Write( | 452 void ParamTraits<BrokerableAttachment::AttachmentId>::Write( |
| 453 Message* m, | 453 Message* m, |
| 454 const param_type& p) { | 454 const param_type& p) { |
| 455 m->WriteBytes(p.nonce, static_cast<int>(BrokerableAttachment::kNonceSize)); | 455 m->WriteBytes(p.nonce, BrokerableAttachment::kNonceSize); |
| 456 } | 456 } |
| 457 | 457 |
| 458 bool ParamTraits<BrokerableAttachment::AttachmentId>::Read( | 458 bool ParamTraits<BrokerableAttachment::AttachmentId>::Read( |
| 459 const Message* m, | 459 const Message* m, |
| 460 base::PickleIterator* iter, | 460 base::PickleIterator* iter, |
| 461 param_type* r) { | 461 param_type* r) { |
| 462 const char* data; | 462 const char* data; |
| 463 if (!iter->ReadBytes(&data, | 463 if (!iter->ReadBytes(&data, BrokerableAttachment::kNonceSize)) |
| 464 static_cast<int>(BrokerableAttachment::kNonceSize))) { | |
| 465 return false; | 464 return false; |
| 466 } | |
| 467 memcpy(r->nonce, data, BrokerableAttachment::kNonceSize); | 465 memcpy(r->nonce, data, BrokerableAttachment::kNonceSize); |
| 468 return true; | 466 return true; |
| 469 } | 467 } |
| 470 | 468 |
| 471 void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p, | 469 void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p, |
| 472 std::string* l) { | 470 std::string* l) { |
| 473 l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize)); | 471 l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize)); |
| 474 } | 472 } |
| 475 | 473 |
| 476 void ParamTraits<base::DictionaryValue>::Write(Message* m, | 474 void ParamTraits<base::DictionaryValue>::Write(Message* m, |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 946 return result; | 944 return result; |
| 947 } | 945 } |
| 948 | 946 |
| 949 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 947 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
| 950 l->append("<MSG>"); | 948 l->append("<MSG>"); |
| 951 } | 949 } |
| 952 | 950 |
| 953 #endif // OS_WIN | 951 #endif // OS_WIN |
| 954 | 952 |
| 955 } // namespace IPC | 953 } // namespace IPC |
| OLD | NEW |