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, BrokerableAttachment::kNonceSize); | 455 m->WriteBytes(p.nonce, static_cast<int>(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, BrokerableAttachment::kNonceSize)) | 463 if (!iter->ReadBytes(&data, |
| 464 static_cast<int>(BrokerableAttachment::kNonceSize))) { |
464 return false; | 465 return false; |
| 466 } |
465 memcpy(r->nonce, data, BrokerableAttachment::kNonceSize); | 467 memcpy(r->nonce, data, BrokerableAttachment::kNonceSize); |
466 return true; | 468 return true; |
467 } | 469 } |
468 | 470 |
469 void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p, | 471 void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p, |
470 std::string* l) { | 472 std::string* l) { |
471 l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize)); | 473 l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize)); |
472 } | 474 } |
473 | 475 |
474 void ParamTraits<base::DictionaryValue>::Write(Message* m, | 476 void ParamTraits<base::DictionaryValue>::Write(Message* m, |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
944 return result; | 946 return result; |
945 } | 947 } |
946 | 948 |
947 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 949 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
948 l->append("<MSG>"); | 950 l->append("<MSG>"); |
949 } | 951 } |
950 | 952 |
951 #endif // OS_WIN | 953 #endif // OS_WIN |
952 | 954 |
953 } // namespace IPC | 955 } // namespace IPC |
OLD | NEW |