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

Side by Side Diff: ipc/ipc_channel_proxy.cc

Issue 1833573002: Move TRACE_EVENT in IPC message dispatch to add message name (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@only_thread_name
Patch Set: Remove patch deppendency. Created 4 years, 8 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 unified diff | Download patch
« no previous file with comments | « chrome/common/trace_event_args_whitelist.cc ('k') | ipc/ipc_message_templates.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ipc/ipc_channel_proxy.h" 5 #include "ipc/ipc_channel_proxy.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
256 // Called on the listener's thread 256 // Called on the listener's thread
257 void ChannelProxy::Context::AddFilter(MessageFilter* filter) { 257 void ChannelProxy::Context::AddFilter(MessageFilter* filter) {
258 base::AutoLock auto_lock(pending_filters_lock_); 258 base::AutoLock auto_lock(pending_filters_lock_);
259 pending_filters_.push_back(make_scoped_refptr(filter)); 259 pending_filters_.push_back(make_scoped_refptr(filter));
260 ipc_task_runner_->PostTask( 260 ipc_task_runner_->PostTask(
261 FROM_HERE, base::Bind(&Context::OnAddFilter, this)); 261 FROM_HERE, base::Bind(&Context::OnAddFilter, this));
262 } 262 }
263 263
264 // Called on the listener's thread 264 // Called on the listener's thread
265 void ChannelProxy::Context::OnDispatchMessage(const Message& message) { 265 void ChannelProxy::Context::OnDispatchMessage(const Message& message) {
266 #if defined(IPC_MESSAGE_LOG_ENABLED)
267 Logging* logger = Logging::GetInstance();
268 std::string name;
269 logger->GetMessageText(message.type(), &name, &message, NULL);
270 TRACE_EVENT1("ipc", "ChannelProxy::Context::OnDispatchMessage",
271 "name", name);
272 #else
273 TRACE_EVENT2("ipc", "ChannelProxy::Context::OnDispatchMessage",
274 "class", IPC_MESSAGE_ID_CLASS(message.type()),
275 "line", IPC_MESSAGE_ID_LINE(message.type()));
276 #endif
277
278 if (!listener_) 266 if (!listener_)
279 return; 267 return;
280 268
281 OnDispatchConnected(); 269 OnDispatchConnected();
282 270
283 #ifdef IPC_MESSAGE_LOG_ENABLED 271 #ifdef IPC_MESSAGE_LOG_ENABLED
272 Logging* logger = Logging::GetInstance();
284 if (message.type() == IPC_LOGGING_ID) { 273 if (message.type() == IPC_LOGGING_ID) {
285 logger->OnReceivedLoggingMessage(message); 274 logger->OnReceivedLoggingMessage(message);
286 return; 275 return;
287 } 276 }
288 277
289 if (logger->Enabled()) 278 if (logger->Enabled())
290 logger->OnPreDispatchMessage(message); 279 logger->OnPreDispatchMessage(message);
291 #endif 280 #endif
292 281
293 listener_->OnMessageReceived(message); 282 listener_->OnMessageReceived(message);
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 return channel->TakeClientFileDescriptor(); 510 return channel->TakeClientFileDescriptor();
522 } 511 }
523 #endif 512 #endif
524 513
525 void ChannelProxy::OnChannelInit() { 514 void ChannelProxy::OnChannelInit() {
526 } 515 }
527 516
528 //----------------------------------------------------------------------------- 517 //-----------------------------------------------------------------------------
529 518
530 } // namespace IPC 519 } // namespace IPC
OLDNEW
« no previous file with comments | « chrome/common/trace_event_args_whitelist.cc ('k') | ipc/ipc_message_templates.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698