From 8bf55ca1e18b9474eea356a2ca75ddc016e46bee Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Mon, 17 Oct 2011 22:15:27 +0000 Subject: Fix IPC logging on Windows. Review URL: http://codereview.chromium.org/8322013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@105937 0039d316-1c4b-4281-b951-d872f2087c98 --- ipc/ipc_message_macros.h | 10 +++++++++- ipc/ipc_message_utils.cc | 9 +++------ 2 files changed, 12 insertions(+), 7 deletions(-) (limited to 'ipc') diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h index 77a8415..7941f43 100644 --- a/ipc/ipc_message_macros.h +++ b/ipc/ipc_message_macros.h @@ -600,6 +600,7 @@ typedef IPC::Message Schema; \ enum { ID = IPC_MESSAGE_ID() }; \ msg_class() : IPC::Message(MSG_ROUTING_CONTROL, ID, PRIORITY_NORMAL) {} \ + static void Log(std::string* name, const Message* msg, std::string* l); \ }; #define IPC_EMPTY_ROUTED_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ @@ -609,6 +610,7 @@ enum { ID = IPC_MESSAGE_ID() }; \ msg_class(int32 routing_id) \ : IPC::Message(routing_id, ID, PRIORITY_NORMAL) {} \ + static void Log(std::string* name, const Message* msg, std::string* l); \ }; #define IPC_ASYNC_CONTROL_DECL(msg_class, in_cnt, out_cnt, in_list, out_list) \ @@ -753,7 +755,13 @@ return Schema::ReadReplyParam(msg, p); \ } -#define IPC_EMPTY_MESSAGE_LOG(msg_class) +#define IPC_EMPTY_MESSAGE_LOG(msg_class) \ + void msg_class::Log(std::string* name, \ + const Message* msg, \ + std::string* l) { \ + if (name) \ + *name = #msg_class; \ + } #define IPC_ASYNC_MESSAGE_LOG(msg_class) \ void msg_class::Log(std::string* name, \ diff --git a/ipc/ipc_message_utils.cc b/ipc/ipc_message_utils.cc index 937dddb..bc5f645 100644 --- a/ipc/ipc_message_utils.cc +++ b/ipc/ipc_message_utils.cc @@ -472,7 +472,7 @@ LogData::~LogData() { void ParamTraits::Write(Message* m, const param_type& p) { WriteParam(m, p.channel); WriteParam(m, p.routing_id); - WriteParam(m, static_cast(p.type)); + WriteParam(m, p.type); WriteParam(m, p.flags); WriteParam(m, p.sent); WriteParam(m, p.receive); @@ -481,18 +481,15 @@ void ParamTraits::Write(Message* m, const param_type& p) { } bool ParamTraits::Read(const Message* m, void** iter, param_type* r) { - int type = -1; - bool result = + return ReadParam(m, iter, &r->channel) && ReadParam(m, iter, &r->routing_id) && - ReadParam(m, iter, &type) && + ReadParam(m, iter, &r->type) && ReadParam(m, iter, &r->flags) && ReadParam(m, iter, &r->sent) && ReadParam(m, iter, &r->receive) && ReadParam(m, iter, &r->dispatch) && ReadParam(m, iter, &r->params); - r->type = static_cast(type); - return result; } } // namespace IPC -- cgit v1.1