0

Improve IPC logging for ChannelHandle and NPVariant_Param

Review URL: http://codereview.chromium.org/7885043

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102475 0039d316-1c4b-4281-b951-d872f2087c98
This commit is contained in:
steveblock@chromium.org
2011-09-23 10:32:19 +00:00
parent 23f991a603
commit 3cd3bce4c4
2 changed files with 5 additions and 0 deletions

@ -302,6 +302,7 @@ bool ParamTraits<NPVariant_Param>::Read(const Message* m,
} }
void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) { void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) {
l->append(StringPrintf("NPVariant_Param(%d, ", static_cast<int>(p.type)));
if (p.type == NPVARIANT_PARAM_BOOL) { if (p.type == NPVARIANT_PARAM_BOOL) {
LogParam(p.bool_value, l); LogParam(p.bool_value, l);
} else if (p.type == NPVARIANT_PARAM_INT) { } else if (p.type == NPVARIANT_PARAM_INT) {
@ -313,7 +314,10 @@ void ParamTraits<NPVariant_Param>::Log(const param_type& p, std::string* l) {
} else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID || } else if (p.type == NPVARIANT_PARAM_SENDER_OBJECT_ROUTING_ID ||
p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) { p.type == NPVARIANT_PARAM_RECEIVER_OBJECT_ROUTING_ID) {
LogParam(p.npobject_routing_id, l); LogParam(p.npobject_routing_id, l);
} else {
l->append("<none>");
} }
l->append(")");
} }
void ParamTraits<NPIdentifier_Param>::Write(Message* m, const param_type& p) { void ParamTraits<NPIdentifier_Param>::Write(Message* m, const param_type& p) {

@ -452,6 +452,7 @@ void ParamTraits<IPC::ChannelHandle>::Log(const param_type& p,
std::string* l) { std::string* l) {
l->append(StringPrintf("ChannelHandle(%s", p.name.c_str())); l->append(StringPrintf("ChannelHandle(%s", p.name.c_str()));
#if defined(OS_POSIX) #if defined(OS_POSIX)
l->append(", ");
ParamTraits<base::FileDescriptor>::Log(p.socket, l); ParamTraits<base::FileDescriptor>::Log(p.socket, l);
#endif #endif
l->append(")"); l->append(")");