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
diff --git a/chrome/common/logging_chrome.cc b/chrome/common/logging_chrome.cc
index 7e49e5e3..f738c3f 100644
--- a/chrome/common/logging_chrome.cc
+++ b/chrome/common/logging_chrome.cc
@@ -16,6 +16,9 @@
// IPC_MESSAGE_MACROS_LOG_ENABLED doesn't get undefined.
#if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED)
#define IPC_MESSAGE_MACROS_LOG_ENABLED
+#include "content/public/common/content_ipc_logging.h"
+#define IPC_LOG_TABLE_ADD_ENTRY(msg_id, logger) \
+ content::RegisterIPCLogger(msg_id, logger)
#include "chrome/common/all_messages.h"
#endif
@@ -258,9 +261,6 @@
DCHECK(!chrome_logging_initialized_) <<
"Attempted to initialize logging when it was already initialized.";
-#if defined(OS_POSIX) && defined(IPC_MESSAGE_LOG_ENABLED)
- IPC::Logging::set_log_function_map(&g_log_function_mapping);
-#endif
LoggingDestination logging_dest = DetermineLogMode(command_line);
LogLockingState log_locking_state = LOCK_LOG_FILE;
FilePath log_path;