Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1095)

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 9389020: Add simple trace logging of received IPC messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/content_message_generator.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index f542eae2b0e59403560c4709afaf96f19ff8c6bf..62c1ecfda6fd9693eb80c9b981d265b8309707b1 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -4,6 +4,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
+#include "base/debug/trace_event.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -238,13 +239,21 @@ void ChannelProxy::Context::AddFilter(MessageFilter* filter) {
// Called on the listener's thread
void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
+ std::string name = "N/A (IPC Logging disabled)";
jbates 2012/02/13 23:26:25 To avoid the overhead of this string, I would move
+#ifdef IPC_MESSAGE_LOG_ENABLED
+ Logging* logger = Logging::GetInstance();
+ logger->GetMessageText(message.type(), &name, &message, NULL);
+#endif
+ TRACE_EVENT2("task", "ChannelProxy::Context::OnDispatchMessage",
+ "type", message.type(),
+ "name", name);
+
if (!listener_)
return;
OnDispatchConnected();
#ifdef IPC_MESSAGE_LOG_ENABLED
- Logging* logger = Logging::GetInstance();
if (message.type() == IPC_LOGGING_ID) {
logger->OnReceivedLoggingMessage(message);
return;
« no previous file with comments | « content/common/content_message_generator.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698