summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 22:15:27 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-17 22:15:27 +0000
commit8bf55ca1e18b9474eea356a2ca75ddc016e46bee (patch)
tree79c81ef60c0fc26efc363a09b738100215b6af6f
parentb33e6b9f0c089dc2520b275ffe64c88d9e34c4ac (diff)
downloadchromium_src-8bf55ca1e18b9474eea356a2ca75ddc016e46bee.zip
chromium_src-8bf55ca1e18b9474eea356a2ca75ddc016e46bee.tar.gz
chromium_src-8bf55ca1e18b9474eea356a2ca75ddc016e46bee.tar.bz2
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
-rw-r--r--chrome/browser/ui/views/about_ipc_dialog.cc9
-rw-r--r--content/renderer/plugin_channel_host.cc2
-rw-r--r--content/renderer/plugin_channel_host.h2
-rw-r--r--ipc/ipc_message_macros.h10
-rw-r--r--ipc/ipc_message_utils.cc9
5 files changed, 19 insertions, 13 deletions
diff --git a/chrome/browser/ui/views/about_ipc_dialog.cc b/chrome/browser/ui/views/about_ipc_dialog.cc
index a0a0bfb..c0b2640 100644
--- a/chrome/browser/ui/views/about_ipc_dialog.cc
+++ b/chrome/browser/ui/views/about_ipc_dialog.cc
@@ -4,13 +4,17 @@
// Need to include this before any other file because it defines
// IPC_MESSAGE_LOG_ENABLED. We need to use it to define
-// IPC_MESSAGE_MACROS_LOG_ENABLED so render_messages.h will generate the
+// IPC_MESSAGE_MACROS_LOG_ENABLED so that all_messages.h will generate the
// ViewMsgLog et al. functions.
#include "ipc/ipc_message.h"
#ifdef IPC_MESSAGE_LOG_ENABLED
#define IPC_MESSAGE_MACROS_LOG_ENABLED
+// We need to do this real early to be sure IPC_MESSAGE_MACROS_LOG_ENABLED
+// doesn't get undefined.
+#include "chrome/common/all_messages.h"
+
#include "chrome/browser/ui/views/about_ipc_dialog.h"
#include <set>
@@ -24,9 +28,6 @@
#include "chrome/browser/browser_process.h"
#include "chrome/browser/ui/browser_dialogs.h"
#include "chrome/common/chrome_constants.h"
-#include "chrome/common/render_messages.h"
-#include "content/common/devtools_messages.h"
-#include "content/common/plugin_messages.h"
#include "net/url_request/url_request.h"
#include "net/url_request/url_request_job.h"
#include "views/controls/button/text_button.h"
diff --git a/content/renderer/plugin_channel_host.cc b/content/renderer/plugin_channel_host.cc
index 69ad605..fb86a85 100644
--- a/content/renderer/plugin_channel_host.cc
+++ b/content/renderer/plugin_channel_host.cc
@@ -134,7 +134,7 @@ void PluginChannelHost::OnSetException(const std::string& message) {
WebKit::WebBindings::setException(NULL, message.c_str());
}
-void PluginChannelHost::OnPluginShuttingDown(const IPC::Message& message) {
+void PluginChannelHost::OnPluginShuttingDown() {
expecting_shutdown_ = true;
}
diff --git a/content/renderer/plugin_channel_host.h b/content/renderer/plugin_channel_host.h
index 38e0bf7..f846795 100644
--- a/content/renderer/plugin_channel_host.h
+++ b/content/renderer/plugin_channel_host.h
@@ -53,7 +53,7 @@ class PluginChannelHost : public NPChannelBase {
virtual bool OnControlMessageReceived(const IPC::Message& message);
void OnSetException(const std::string& message);
- void OnPluginShuttingDown(const IPC::Message& message);
+ void OnPluginShuttingDown();
// Keep track of all the registered WebPluginDelegeProxies to
// inform about OnChannelError
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<LogData>::Write(Message* m, const param_type& p) {
WriteParam(m, p.channel);
WriteParam(m, p.routing_id);
- WriteParam(m, static_cast<int>(p.type));
+ WriteParam(m, p.type);
WriteParam(m, p.flags);
WriteParam(m, p.sent);
WriteParam(m, p.receive);
@@ -481,18 +481,15 @@ void ParamTraits<LogData>::Write(Message* m, const param_type& p) {
}
bool ParamTraits<LogData>::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<uint16>(type);
- return result;
}
} // namespace IPC