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
3 // found in the LICENSE file.
5 #include "ipc/ipc_message_utils.h"
7 #include "base/files/file_path.h"
8 #include "base/json/json_writer.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/strings/nullable_string16.h"
11 #include "base/strings/string_number_conversions.h"
12 #include "base/strings/utf_string_conversions.h"
13 #include "base/time/time.h"
14 #include "base/values.h"
15 #include "ipc/ipc_channel_handle.h"
16 #include "ipc/ipc_message_attachment.h"
17 #include "ipc/ipc_message_attachment_set.h"
20 #include "ipc/ipc_platform_file_attachment_posix.h"
31 const int kMaxRecursionDepth
= 100;
33 template<typename CharType
>
34 void LogBytes(const std::vector
<CharType
>& data
, std::string
* out
) {
36 // Windows has a GUI for logging, which can handle arbitrary binary data.
37 for (size_t i
= 0; i
< data
.size(); ++i
)
38 out
->push_back(data
[i
]);
40 // On POSIX, we log to stdout, which we assume can display ASCII.
41 static const size_t kMaxBytesToLog
= 100;
42 for (size_t i
= 0; i
< std::min(data
.size(), kMaxBytesToLog
); ++i
) {
44 out
->push_back(data
[i
]);
47 base::StringPrintf("[%02X]", static_cast<unsigned char>(data
[i
])));
49 if (data
.size() > kMaxBytesToLog
) {
50 out
->append(base::StringPrintf(
52 static_cast<unsigned>(data
.size() - kMaxBytesToLog
)));
57 bool ReadValue(const Message
* m
, PickleIterator
* iter
, base::Value
** value
,
60 void WriteValue(Message
* m
, const base::Value
* value
, int recursion
) {
62 if (recursion
> kMaxRecursionDepth
) {
63 LOG(WARNING
) << "Max recursion depth hit in WriteValue.";
67 m
->WriteInt(value
->GetType());
69 switch (value
->GetType()) {
70 case base::Value::TYPE_NULL
:
72 case base::Value::TYPE_BOOLEAN
: {
74 result
= value
->GetAsBoolean(&val
);
79 case base::Value::TYPE_INTEGER
: {
81 result
= value
->GetAsInteger(&val
);
86 case base::Value::TYPE_DOUBLE
: {
88 result
= value
->GetAsDouble(&val
);
93 case base::Value::TYPE_STRING
: {
95 result
= value
->GetAsString(&val
);
100 case base::Value::TYPE_BINARY
: {
101 const base::BinaryValue
* binary
=
102 static_cast<const base::BinaryValue
*>(value
);
103 m
->WriteData(binary
->GetBuffer(), static_cast<int>(binary
->GetSize()));
106 case base::Value::TYPE_DICTIONARY
: {
107 const base::DictionaryValue
* dict
=
108 static_cast<const base::DictionaryValue
*>(value
);
110 WriteParam(m
, static_cast<int>(dict
->size()));
112 for (base::DictionaryValue::Iterator
it(*dict
); !it
.IsAtEnd();
114 WriteParam(m
, it
.key());
115 WriteValue(m
, &it
.value(), recursion
+ 1);
119 case base::Value::TYPE_LIST
: {
120 const base::ListValue
* list
= static_cast<const base::ListValue
*>(value
);
121 WriteParam(m
, static_cast<int>(list
->GetSize()));
122 for (base::ListValue::const_iterator it
= list
->begin();
123 it
!= list
->end(); ++it
) {
124 WriteValue(m
, *it
, recursion
+ 1);
131 // Helper for ReadValue that reads a DictionaryValue into a pre-allocated
133 bool ReadDictionaryValue(const Message
* m
, PickleIterator
* iter
,
134 base::DictionaryValue
* value
, int recursion
) {
136 if (!ReadParam(m
, iter
, &size
))
139 for (int i
= 0; i
< size
; ++i
) {
142 if (!ReadParam(m
, iter
, &key
) ||
143 !ReadValue(m
, iter
, &subval
, recursion
+ 1))
145 value
->SetWithoutPathExpansion(key
, subval
);
151 // Helper for ReadValue that reads a ReadListValue into a pre-allocated
153 bool ReadListValue(const Message
* m
, PickleIterator
* iter
,
154 base::ListValue
* value
, int recursion
) {
156 if (!ReadParam(m
, iter
, &size
))
159 for (int i
= 0; i
< size
; ++i
) {
161 if (!ReadValue(m
, iter
, &subval
, recursion
+ 1))
163 value
->Set(i
, subval
);
169 bool ReadValue(const Message
* m
, PickleIterator
* iter
, base::Value
** value
,
171 if (recursion
> kMaxRecursionDepth
) {
172 LOG(WARNING
) << "Max recursion depth hit in ReadValue.";
177 if (!ReadParam(m
, iter
, &type
))
181 case base::Value::TYPE_NULL
:
182 *value
= base::Value::CreateNullValue();
184 case base::Value::TYPE_BOOLEAN
: {
186 if (!ReadParam(m
, iter
, &val
))
188 *value
= new base::FundamentalValue(val
);
191 case base::Value::TYPE_INTEGER
: {
193 if (!ReadParam(m
, iter
, &val
))
195 *value
= new base::FundamentalValue(val
);
198 case base::Value::TYPE_DOUBLE
: {
200 if (!ReadParam(m
, iter
, &val
))
202 *value
= new base::FundamentalValue(val
);
205 case base::Value::TYPE_STRING
: {
207 if (!ReadParam(m
, iter
, &val
))
209 *value
= new base::StringValue(val
);
212 case base::Value::TYPE_BINARY
: {
215 if (!iter
->ReadData(&data
, &length
))
217 *value
= base::BinaryValue::CreateWithCopiedBuffer(data
, length
);
220 case base::Value::TYPE_DICTIONARY
: {
221 scoped_ptr
<base::DictionaryValue
> val(new base::DictionaryValue());
222 if (!ReadDictionaryValue(m
, iter
, val
.get(), recursion
))
224 *value
= val
.release();
227 case base::Value::TYPE_LIST
: {
228 scoped_ptr
<base::ListValue
> val(new base::ListValue());
229 if (!ReadListValue(m
, iter
, val
.get(), recursion
))
231 *value
= val
.release();
243 // -----------------------------------------------------------------------------
253 LogData::~LogData() {
256 void ParamTraits
<bool>::Log(const param_type
& p
, std::string
* l
) {
257 l
->append(p
? "true" : "false");
260 void ParamTraits
<unsigned char>::Write(Message
* m
, const param_type
& p
) {
261 m
->WriteBytes(&p
, sizeof(param_type
));
264 bool ParamTraits
<unsigned char>::Read(const Message
* m
, PickleIterator
* iter
,
267 if (!iter
->ReadBytes(&data
, sizeof(param_type
)))
269 memcpy(r
, data
, sizeof(param_type
));
273 void ParamTraits
<unsigned char>::Log(const param_type
& p
, std::string
* l
) {
274 l
->append(base::UintToString(p
));
277 void ParamTraits
<unsigned short>::Write(Message
* m
, const param_type
& p
) {
278 m
->WriteBytes(&p
, sizeof(param_type
));
281 bool ParamTraits
<unsigned short>::Read(const Message
* m
, PickleIterator
* iter
,
284 if (!iter
->ReadBytes(&data
, sizeof(param_type
)))
286 memcpy(r
, data
, sizeof(param_type
));
290 void ParamTraits
<unsigned short>::Log(const param_type
& p
, std::string
* l
) {
291 l
->append(base::UintToString(p
));
294 void ParamTraits
<int>::Log(const param_type
& p
, std::string
* l
) {
295 l
->append(base::IntToString(p
));
298 void ParamTraits
<unsigned int>::Log(const param_type
& p
, std::string
* l
) {
299 l
->append(base::UintToString(p
));
302 void ParamTraits
<long>::Log(const param_type
& p
, std::string
* l
) {
303 l
->append(base::Int64ToString(static_cast<int64
>(p
)));
306 void ParamTraits
<unsigned long>::Log(const param_type
& p
, std::string
* l
) {
307 l
->append(base::Uint64ToString(static_cast<uint64
>(p
)));
310 void ParamTraits
<long long>::Log(const param_type
& p
, std::string
* l
) {
311 l
->append(base::Int64ToString(static_cast<int64
>(p
)));
314 void ParamTraits
<unsigned long long>::Log(const param_type
& p
, std::string
* l
) {
315 l
->append(base::Uint64ToString(p
));
318 void ParamTraits
<float>::Log(const param_type
& p
, std::string
* l
) {
319 l
->append(base::StringPrintf("%e", p
));
322 void ParamTraits
<double>::Write(Message
* m
, const param_type
& p
) {
323 m
->WriteBytes(reinterpret_cast<const char*>(&p
), sizeof(param_type
));
326 bool ParamTraits
<double>::Read(const Message
* m
, PickleIterator
* iter
,
329 if (!iter
->ReadBytes(&data
, sizeof(*r
))) {
333 memcpy(r
, data
, sizeof(param_type
));
337 void ParamTraits
<double>::Log(const param_type
& p
, std::string
* l
) {
338 l
->append(base::StringPrintf("%e", p
));
342 void ParamTraits
<std::string
>::Log(const param_type
& p
, std::string
* l
) {
346 void ParamTraits
<base::string16
>::Log(const param_type
& p
, std::string
* l
) {
347 l
->append(base::UTF16ToUTF8(p
));
350 void ParamTraits
<std::vector
<char> >::Write(Message
* m
, const param_type
& p
) {
352 m
->WriteData(NULL
, 0);
354 m
->WriteData(&p
.front(), static_cast<int>(p
.size()));
358 bool ParamTraits
<std::vector
<char> >::Read(const Message
* m
,
359 PickleIterator
* iter
,
363 if (!iter
->ReadData(&data
, &data_size
) || data_size
< 0)
365 r
->resize(data_size
);
367 memcpy(&r
->front(), data
, data_size
);
371 void ParamTraits
<std::vector
<char> >::Log(const param_type
& p
, std::string
* l
) {
375 void ParamTraits
<std::vector
<unsigned char> >::Write(Message
* m
,
376 const param_type
& p
) {
378 m
->WriteData(NULL
, 0);
380 m
->WriteData(reinterpret_cast<const char*>(&p
.front()),
381 static_cast<int>(p
.size()));
385 bool ParamTraits
<std::vector
<unsigned char> >::Read(const Message
* m
,
386 PickleIterator
* iter
,
390 if (!iter
->ReadData(&data
, &data_size
) || data_size
< 0)
392 r
->resize(data_size
);
394 memcpy(&r
->front(), data
, data_size
);
398 void ParamTraits
<std::vector
<unsigned char> >::Log(const param_type
& p
,
403 void ParamTraits
<std::vector
<bool> >::Write(Message
* m
, const param_type
& p
) {
404 WriteParam(m
, static_cast<int>(p
.size()));
405 // Cast to bool below is required because libc++'s
406 // vector<bool>::const_reference is different from bool, and we want to avoid
407 // writing an extra specialization of ParamTraits for it.
408 for (size_t i
= 0; i
< p
.size(); i
++)
409 WriteParam(m
, static_cast<bool>(p
[i
]));
412 bool ParamTraits
<std::vector
<bool> >::Read(const Message
* m
,
413 PickleIterator
* iter
,
416 // ReadLength() checks for < 0 itself.
417 if (!iter
->ReadLength(&size
))
420 for (int i
= 0; i
< size
; i
++) {
422 if (!ReadParam(m
, iter
, &value
))
429 void ParamTraits
<std::vector
<bool> >::Log(const param_type
& p
, std::string
* l
) {
430 for (size_t i
= 0; i
< p
.size(); ++i
) {
433 LogParam(static_cast<bool>(p
[i
]), l
);
437 void ParamTraits
<base::DictionaryValue
>::Write(Message
* m
,
438 const param_type
& p
) {
439 WriteValue(m
, &p
, 0);
442 bool ParamTraits
<base::DictionaryValue
>::Read(
443 const Message
* m
, PickleIterator
* iter
, param_type
* r
) {
445 if (!ReadParam(m
, iter
, &type
) || type
!= base::Value::TYPE_DICTIONARY
)
448 return ReadDictionaryValue(m
, iter
, r
, 0);
451 void ParamTraits
<base::DictionaryValue
>::Log(const param_type
& p
,
454 base::JSONWriter::Write(&p
, &json
);
458 #if defined(OS_POSIX)
459 void ParamTraits
<base::FileDescriptor
>::Write(Message
* m
, const param_type
& p
) {
460 const bool valid
= p
.fd
>= 0;
461 WriteParam(m
, valid
);
467 if (!m
->WriteAttachment(
468 new internal::PlatformFileAttachment(base::ScopedFD(p
.fd
))))
471 if (!m
->WriteAttachment(new internal::PlatformFileAttachment(p
.fd
)))
476 bool ParamTraits
<base::FileDescriptor
>::Read(const Message
* m
,
477 PickleIterator
* iter
,
479 *r
= base::FileDescriptor();
482 if (!ReadParam(m
, iter
, &valid
))
485 // TODO(morrita): Seems like this should return false.
489 scoped_refptr
<MessageAttachment
> attachment
;
490 if (!m
->ReadAttachment(iter
, &attachment
))
493 *r
= base::FileDescriptor(attachment
->TakePlatformFile(), true);
497 void ParamTraits
<base::FileDescriptor
>::Log(const param_type
& p
,
500 l
->append(base::StringPrintf("FD(%d auto-close)", p
.fd
));
502 l
->append(base::StringPrintf("FD(%d)", p
.fd
));
505 #endif // defined(OS_POSIX)
507 void ParamTraits
<base::FilePath
>::Write(Message
* m
, const param_type
& p
) {
511 bool ParamTraits
<base::FilePath
>::Read(const Message
* m
,
512 PickleIterator
* iter
,
514 return r
->ReadFromPickle(iter
);
517 void ParamTraits
<base::FilePath
>::Log(const param_type
& p
, std::string
* l
) {
518 ParamTraits
<base::FilePath::StringType
>::Log(p
.value(), l
);
521 void ParamTraits
<base::ListValue
>::Write(Message
* m
, const param_type
& p
) {
522 WriteValue(m
, &p
, 0);
525 bool ParamTraits
<base::ListValue
>::Read(
526 const Message
* m
, PickleIterator
* iter
, param_type
* r
) {
528 if (!ReadParam(m
, iter
, &type
) || type
!= base::Value::TYPE_LIST
)
531 return ReadListValue(m
, iter
, r
, 0);
534 void ParamTraits
<base::ListValue
>::Log(const param_type
& p
, std::string
* l
) {
536 base::JSONWriter::Write(&p
, &json
);
540 void ParamTraits
<base::NullableString16
>::Write(Message
* m
,
541 const param_type
& p
) {
542 WriteParam(m
, p
.string());
543 WriteParam(m
, p
.is_null());
546 bool ParamTraits
<base::NullableString16
>::Read(const Message
* m
,
547 PickleIterator
* iter
,
549 base::string16 string
;
550 if (!ReadParam(m
, iter
, &string
))
553 if (!ReadParam(m
, iter
, &is_null
))
555 *r
= base::NullableString16(string
, is_null
);
559 void ParamTraits
<base::NullableString16
>::Log(const param_type
& p
,
562 LogParam(p
.string(), l
);
564 LogParam(p
.is_null(), l
);
568 void ParamTraits
<base::File::Info
>::Write(Message
* m
,
569 const param_type
& p
) {
570 WriteParam(m
, p
.size
);
571 WriteParam(m
, p
.is_directory
);
572 WriteParam(m
, p
.last_modified
.ToDoubleT());
573 WriteParam(m
, p
.last_accessed
.ToDoubleT());
574 WriteParam(m
, p
.creation_time
.ToDoubleT());
577 bool ParamTraits
<base::File::Info
>::Read(const Message
* m
,
578 PickleIterator
* iter
,
580 double last_modified
, last_accessed
, creation_time
;
581 if (!ReadParam(m
, iter
, &p
->size
) ||
582 !ReadParam(m
, iter
, &p
->is_directory
) ||
583 !ReadParam(m
, iter
, &last_modified
) ||
584 !ReadParam(m
, iter
, &last_accessed
) ||
585 !ReadParam(m
, iter
, &creation_time
))
587 p
->last_modified
= base::Time::FromDoubleT(last_modified
);
588 p
->last_accessed
= base::Time::FromDoubleT(last_accessed
);
589 p
->creation_time
= base::Time::FromDoubleT(creation_time
);
593 void ParamTraits
<base::File::Info
>::Log(const param_type
& p
,
598 LogParam(p
.is_directory
, l
);
600 LogParam(p
.last_modified
.ToDoubleT(), l
);
602 LogParam(p
.last_accessed
.ToDoubleT(), l
);
604 LogParam(p
.creation_time
.ToDoubleT(), l
);
608 void ParamTraits
<base::Time
>::Write(Message
* m
, const param_type
& p
) {
609 ParamTraits
<int64
>::Write(m
, p
.ToInternalValue());
612 bool ParamTraits
<base::Time
>::Read(const Message
* m
, PickleIterator
* iter
,
615 if (!ParamTraits
<int64
>::Read(m
, iter
, &value
))
617 *r
= base::Time::FromInternalValue(value
);
621 void ParamTraits
<base::Time
>::Log(const param_type
& p
, std::string
* l
) {
622 ParamTraits
<int64
>::Log(p
.ToInternalValue(), l
);
625 void ParamTraits
<base::TimeDelta
>::Write(Message
* m
, const param_type
& p
) {
626 ParamTraits
<int64
>::Write(m
, p
.ToInternalValue());
629 bool ParamTraits
<base::TimeDelta
>::Read(const Message
* m
,
630 PickleIterator
* iter
,
633 bool ret
= ParamTraits
<int64
>::Read(m
, iter
, &value
);
635 *r
= base::TimeDelta::FromInternalValue(value
);
640 void ParamTraits
<base::TimeDelta
>::Log(const param_type
& p
, std::string
* l
) {
641 ParamTraits
<int64
>::Log(p
.ToInternalValue(), l
);
644 void ParamTraits
<base::TimeTicks
>::Write(Message
* m
, const param_type
& p
) {
645 ParamTraits
<int64
>::Write(m
, p
.ToInternalValue());
648 bool ParamTraits
<base::TimeTicks
>::Read(const Message
* m
,
649 PickleIterator
* iter
,
652 bool ret
= ParamTraits
<int64
>::Read(m
, iter
, &value
);
654 *r
= base::TimeTicks::FromInternalValue(value
);
659 void ParamTraits
<base::TimeTicks
>::Log(const param_type
& p
, std::string
* l
) {
660 ParamTraits
<int64
>::Log(p
.ToInternalValue(), l
);
663 void ParamTraits
<IPC::ChannelHandle
>::Write(Message
* m
, const param_type
& p
) {
665 // On Windows marshalling pipe handle is not supported.
666 DCHECK(p
.pipe
.handle
== NULL
);
667 #endif // defined (OS_WIN)
668 WriteParam(m
, p
.name
);
669 #if defined(OS_POSIX)
670 WriteParam(m
, p
.socket
);
674 bool ParamTraits
<IPC::ChannelHandle
>::Read(const Message
* m
,
675 PickleIterator
* iter
,
677 return ReadParam(m
, iter
, &r
->name
)
678 #if defined(OS_POSIX)
679 && ReadParam(m
, iter
, &r
->socket
)
684 void ParamTraits
<IPC::ChannelHandle
>::Log(const param_type
& p
,
686 l
->append(base::StringPrintf("ChannelHandle(%s", p
.name
.c_str()));
687 #if defined(OS_POSIX)
689 ParamTraits
<base::FileDescriptor
>::Log(p
.socket
, l
);
694 void ParamTraits
<LogData
>::Write(Message
* m
, const param_type
& p
) {
695 WriteParam(m
, p
.channel
);
696 WriteParam(m
, p
.routing_id
);
697 WriteParam(m
, p
.type
);
698 WriteParam(m
, p
.flags
);
699 WriteParam(m
, p
.sent
);
700 WriteParam(m
, p
.receive
);
701 WriteParam(m
, p
.dispatch
);
702 WriteParam(m
, p
.message_name
);
703 WriteParam(m
, p
.params
);
706 bool ParamTraits
<LogData
>::Read(const Message
* m
,
707 PickleIterator
* iter
,
710 ReadParam(m
, iter
, &r
->channel
) &&
711 ReadParam(m
, iter
, &r
->routing_id
) &&
712 ReadParam(m
, iter
, &r
->type
) &&
713 ReadParam(m
, iter
, &r
->flags
) &&
714 ReadParam(m
, iter
, &r
->sent
) &&
715 ReadParam(m
, iter
, &r
->receive
) &&
716 ReadParam(m
, iter
, &r
->dispatch
) &&
717 ReadParam(m
, iter
, &r
->message_name
) &&
718 ReadParam(m
, iter
, &r
->params
);
721 void ParamTraits
<LogData
>::Log(const param_type
& p
, std::string
* l
) {
722 // Doesn't make sense to implement this!
725 void ParamTraits
<Message
>::Write(Message
* m
, const Message
& p
) {
726 #if defined(OS_POSIX)
727 // We don't serialize the file descriptors in the nested message, so there
728 // better not be any.
729 DCHECK(!p
.HasAttachments());
732 // Don't just write out the message. This is used to send messages between
733 // NaCl (Posix environment) and the browser (could be on Windows). The message
734 // header formats differ between these systems (so does handle sharing, but
735 // we already asserted we don't have any handles). So just write out the
736 // parts of the header we use.
738 // Be careful also to use only explicitly-sized types. The NaCl environment
739 // could be 64-bit and the host browser could be 32-bits. The nested message
740 // may or may not be safe to send between 32-bit and 64-bit systems, but we
741 // leave that up to the code sending the message to ensure.
742 m
->WriteUInt32(static_cast<uint32
>(p
.routing_id()));
743 m
->WriteUInt32(p
.type());
744 m
->WriteUInt32(p
.flags());
745 m
->WriteData(p
.payload(), static_cast<uint32
>(p
.payload_size()));
748 bool ParamTraits
<Message
>::Read(const Message
* m
, PickleIterator
* iter
,
750 uint32 routing_id
, type
, flags
;
751 if (!iter
->ReadUInt32(&routing_id
) ||
752 !iter
->ReadUInt32(&type
) ||
753 !iter
->ReadUInt32(&flags
))
758 if (!iter
->ReadData(&payload
, &payload_size
))
761 r
->SetHeaderValues(static_cast<int32
>(routing_id
), type
, flags
);
762 return r
->WriteBytes(payload
, payload_size
);
765 void ParamTraits
<Message
>::Log(const Message
& p
, std::string
* l
) {
766 l
->append("<IPC::Message>");
770 // Note that HWNDs/HANDLE/HCURSOR/HACCEL etc are always 32 bits, even on 64
771 // bit systems. That's why we use the Windows macros to convert to 32 bits.
772 void ParamTraits
<HANDLE
>::Write(Message
* m
, const param_type
& p
) {
773 m
->WriteInt(HandleToLong(p
));
776 bool ParamTraits
<HANDLE
>::Read(const Message
* m
, PickleIterator
* iter
,
779 if (!iter
->ReadInt(&temp
))
781 *r
= LongToHandle(temp
);
785 void ParamTraits
<HANDLE
>::Log(const param_type
& p
, std::string
* l
) {
786 l
->append(base::StringPrintf("0x%X", p
));
789 void ParamTraits
<LOGFONT
>::Write(Message
* m
, const param_type
& p
) {
790 m
->WriteData(reinterpret_cast<const char*>(&p
), sizeof(LOGFONT
));
793 bool ParamTraits
<LOGFONT
>::Read(const Message
* m
, PickleIterator
* iter
,
797 if (iter
->ReadData(&data
, &data_size
) && data_size
== sizeof(LOGFONT
)) {
798 const LOGFONT
*font
= reinterpret_cast<LOGFONT
*>(const_cast<char*>(data
));
799 if (_tcsnlen(font
->lfFaceName
, LF_FACESIZE
) < LF_FACESIZE
) {
800 memcpy(r
, data
, sizeof(LOGFONT
));
809 void ParamTraits
<LOGFONT
>::Log(const param_type
& p
, std::string
* l
) {
810 l
->append(base::StringPrintf("<LOGFONT>"));
813 void ParamTraits
<MSG
>::Write(Message
* m
, const param_type
& p
) {
814 m
->WriteData(reinterpret_cast<const char*>(&p
), sizeof(MSG
));
817 bool ParamTraits
<MSG
>::Read(const Message
* m
, PickleIterator
* iter
,
821 bool result
= iter
->ReadData(&data
, &data_size
);
822 if (result
&& data_size
== sizeof(MSG
)) {
823 memcpy(r
, data
, sizeof(MSG
));
832 void ParamTraits
<MSG
>::Log(const param_type
& p
, std::string
* l
) {