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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
580 } | 580 } |
581 | 581 |
582 void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { | 582 void ParamTraits<std::vector<bool> >::Log(const param_type& p, std::string* l) { |
583 for (size_t i = 0; i < p.size(); ++i) { | 583 for (size_t i = 0; i < p.size(); ++i) { |
584 if (i != 0) | 584 if (i != 0) |
585 l->push_back(' '); | 585 l->push_back(' '); |
586 LogParam(static_cast<bool>(p[i]), l); | 586 LogParam(static_cast<bool>(p[i]), l); |
587 } | 587 } |
588 } | 588 } |
589 | 589 |
590 void ParamTraits<BrokerableAttachment::AttachmentId>::Write( | |
591 base::Pickle* m, | |
592 const param_type& p) { | |
593 m->WriteBytes(p.nonce, BrokerableAttachment::kNonceSize); | |
594 } | |
595 | |
596 bool ParamTraits<BrokerableAttachment::AttachmentId>::Read( | |
597 const base::Pickle* m, | |
598 base::PickleIterator* iter, | |
599 param_type* r) { | |
600 const char* data; | |
601 if (!iter->ReadBytes(&data, BrokerableAttachment::kNonceSize)) | |
602 return false; | |
603 memcpy(r->nonce, data, BrokerableAttachment::kNonceSize); | |
604 return true; | |
605 } | |
606 | |
607 void ParamTraits<BrokerableAttachment::AttachmentId>::Log(const param_type& p, | |
608 std::string* l) { | |
609 l->append(base::HexEncode(p.nonce, BrokerableAttachment::kNonceSize)); | |
610 } | |
611 | |
612 void ParamTraits<base::DictionaryValue>::GetSize(base::PickleSizer* sizer, | 590 void ParamTraits<base::DictionaryValue>::GetSize(base::PickleSizer* sizer, |
613 const param_type& p) { | 591 const param_type& p) { |
614 GetValueSize(sizer, &p, 0); | 592 GetValueSize(sizer, &p, 0); |
615 } | 593 } |
616 | 594 |
617 void ParamTraits<base::DictionaryValue>::Write(base::Pickle* m, | 595 void ParamTraits<base::DictionaryValue>::Write(base::Pickle* m, |
618 const param_type& p) { | 596 const param_type& p) { |
619 WriteValue(m, &p, 0); | 597 WriteValue(m, &p, 0); |
620 } | 598 } |
621 | 599 |
(...skipping 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1251 return result; | 1229 return result; |
1252 } | 1230 } |
1253 | 1231 |
1254 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { | 1232 void ParamTraits<MSG>::Log(const param_type& p, std::string* l) { |
1255 l->append("<MSG>"); | 1233 l->append("<MSG>"); |
1256 } | 1234 } |
1257 | 1235 |
1258 #endif // OS_WIN | 1236 #endif // OS_WIN |
1259 | 1237 |
1260 } // namespace IPC | 1238 } // namespace IPC |
OLD | NEW |