| 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_sync_channel.h" | 5 #include "ipc/ipc_sync_channel.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/debug/trace_event.h" | 8 #include "base/debug/trace_event.h" |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/location.h" | 10 #include "base/location.h" |
| (...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 | 454 |
| 455 SyncChannel::~SyncChannel() { | 455 SyncChannel::~SyncChannel() { |
| 456 } | 456 } |
| 457 | 457 |
| 458 void SyncChannel::SetRestrictDispatchChannelGroup(int group) { | 458 void SyncChannel::SetRestrictDispatchChannelGroup(int group) { |
| 459 sync_context()->set_restrict_dispatch_group(group); | 459 sync_context()->set_restrict_dispatch_group(group); |
| 460 } | 460 } |
| 461 | 461 |
| 462 bool SyncChannel::Send(Message* message) { | 462 bool SyncChannel::Send(Message* message) { |
| 463 #ifdef IPC_MESSAGE_LOG_ENABLED | 463 #ifdef IPC_MESSAGE_LOG_ENABLED |
| 464 Logging* logger = Logging::GetInstance(); | |
| 465 std::string name; | 464 std::string name; |
| 466 logger->GetMessageText(message->type(), &name, message, NULL); | 465 Logging::GetInstance()->GetMessageText(message->type(), &name, message, NULL); |
| 467 TRACE_EVENT1("ipc", "SyncChannel::Send", "name", name); | 466 TRACE_EVENT1("ipc", "SyncChannel::Send", "name", name); |
| 468 #else | 467 #else |
| 469 TRACE_EVENT2("ipc", "SyncChannel::Send", | 468 TRACE_EVENT2("ipc", "SyncChannel::Send", |
| 470 "class", IPC_MESSAGE_ID_CLASS(message->type()), | 469 "class", IPC_MESSAGE_ID_CLASS(message->type()), |
| 471 "line", IPC_MESSAGE_ID_LINE(message->type())); | 470 "line", IPC_MESSAGE_ID_LINE(message->type())); |
| 472 #endif | 471 #endif |
| 473 if (!message->is_sync()) { | 472 if (!message->is_sync()) { |
| 474 ChannelProxy::Send(message); | 473 ChannelProxy::Send(message); |
| 475 return true; | 474 return true; |
| 476 } | 475 } |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 578 // manual reset since the object watcher might otherwise reset the event | 577 // manual reset since the object watcher might otherwise reset the event |
| 579 // when we're doing a WaitMany. | 578 // when we're doing a WaitMany. |
| 580 dispatch_watcher_callback_ = | 579 dispatch_watcher_callback_ = |
| 581 base::Bind(&SyncChannel::OnWaitableEventSignaled, | 580 base::Bind(&SyncChannel::OnWaitableEventSignaled, |
| 582 base::Unretained(this)); | 581 base::Unretained(this)); |
| 583 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), | 582 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), |
| 584 dispatch_watcher_callback_); | 583 dispatch_watcher_callback_); |
| 585 } | 584 } |
| 586 | 585 |
| 587 } // namespace IPC | 586 } // namespace IPC |
| OLD | NEW |