summaryrefslogtreecommitdiffstats
path: root/chrome/common/ipc_message_macros.h
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 05:38:41 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-11 05:38:41 +0000
commit3335d879a364867309a93749cc9e4805bd92d114 (patch)
treec974aab1fd40e1d4f91e9eb768697a8286ea0dc8 /chrome/common/ipc_message_macros.h
parentb0a604b351995345bcf9f17ae403495e30fe4cdc (diff)
downloadchromium_src-3335d879a364867309a93749cc9e4805bd92d114.zip
chromium_src-3335d879a364867309a93749cc9e4805bd92d114.tar.gz
chromium_src-3335d879a364867309a93749cc9e4805bd92d114.tar.bz2
Redo my IPC change, undoing the linker dependency.
Review URL: http://codereview.chromium.org/21225 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9557 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/ipc_message_macros.h')
-rw-r--r--chrome/common/ipc_message_macros.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/chrome/common/ipc_message_macros.h b/chrome/common/ipc_message_macros.h
index fe39efa..411752f 100644
--- a/chrome/common/ipc_message_macros.h
+++ b/chrome/common/ipc_message_macros.h
@@ -365,6 +365,17 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
#elif defined(IPC_MESSAGE_MACROS_LOG)
#undef IPC_MESSAGE_MACROS_LOG
+#ifndef IPC_LOG_TABLE_CREATED
+#define IPC_LOG_TABLE_CREATED
+typedef void (*LogFunction)(uint16 type,
+ std::wstring* name,
+ const IPC::Message* msg,
+ std::wstring* params);
+
+LogFunction g_log_function_mapping[LastMsgIndex];
+#endif
+
+
#define IPC_BEGIN_MESSAGES(label) \
void label##MsgLog(uint16 type, std::wstring* name, const IPC::Message* msg, std::wstring* params) { \
switch (type) {
@@ -374,7 +385,14 @@ void class_name::OnMessageReceived(const IPC::Message& msg) \
if (name) \
*name = L"[UNKNOWN " L ## #label L" MSG"; \
} \
- }
+ } \
+ class LoggerRegisterHelper##label { \
+ public: \
+ LoggerRegisterHelper##label() { \
+ g_log_function_mapping[label##MsgStart] = label##MsgLog; \
+ } \
+ }; \
+ LoggerRegisterHelper##label g_LoggerRegisterHelper##label;
#define IPC_MESSAGE_LOG(msg_class) \
case msg_class##__ID: \