OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |