summaryrefslogtreecommitdiffstats
path: root/ipc
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 05:24:07 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 05:24:07 +0000
commit4f68ed70ed3e039661b8e492805982e63e80b15b (patch)
treec1a183a80140c214f9e4d5cdc6c6bd18cd5e5ffd /ipc
parentc3cbe3536b4885fdc2a7ece5863e273a47c42964 (diff)
downloadchromium_src-4f68ed70ed3e039661b8e492805982e63e80b15b.zip
chromium_src-4f68ed70ed3e039661b8e492805982e63e80b15b.tar.gz
chromium_src-4f68ed70ed3e039661b8e492805982e63e80b15b.tar.bz2
Split IPC logging between content and chrome.
I add a new content API to register IPC message loggers, and modify the IPC message macros to not directly create the g_log_function_mapping. That allows for multiple files generating IPC loggers. Also, it gets rid of the ctor/dtor for the g_log_function_mapping. BUG=101600,111316,155765 Review URL: https://codereview.chromium.org/11347012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164861 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc')
-rw-r--r--ipc/ipc_message_macros.h18
1 files changed, 4 insertions, 14 deletions
diff --git a/ipc/ipc_message_macros.h b/ipc/ipc_message_macros.h
index f77abb2..2993014 100644
--- a/ipc/ipc_message_macros.h
+++ b/ipc/ipc_message_macros.h
@@ -800,19 +800,9 @@
#elif defined(IPC_MESSAGE_MACROS_LOG_ENABLED)
-#ifndef IPC_LOG_TABLE_CREATED
-#define IPC_LOG_TABLE_CREATED
-
-#include "base/hash_tables.h"
-
-typedef void (*LogFunction)(std::string* name,
- const IPC::Message* msg,
- std::string* params);
-
-typedef base::hash_map<uint32, LogFunction > LogFunctionMap;
-LogFunctionMap g_log_function_mapping;
-
-#endif // IPC_LOG_TABLE_CREATED
+#ifndef IPC_LOG_TABLE_ADD_ENTRY
+#error You need to define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger)
+#endif
// "Log table" inclusion produces extra logging registration code.
#define IPC_MESSAGE_EXTRA(sync, kind, msg_class, \
@@ -821,7 +811,7 @@ LogFunctionMap g_log_function_mapping;
public: \
LoggerRegisterHelper##msg_class() { \
const uint32 msg_id = static_cast<uint32>(msg_class::ID); \
- g_log_function_mapping[msg_id] = msg_class::Log; \
+ IPC_LOG_TABLE_ADD_ENTRY(msg_id, msg_class::Log); \
} \
}; \
LoggerRegisterHelper##msg_class g_LoggerRegisterHelper##msg_class;