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 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 435 |
436 void SyncChannel::SetRestrictDispatchChannelGroup(int group) { | 436 void SyncChannel::SetRestrictDispatchChannelGroup(int group) { |
437 sync_context()->set_restrict_dispatch_group(group); | 437 sync_context()->set_restrict_dispatch_group(group); |
438 } | 438 } |
439 | 439 |
440 bool SyncChannel::Send(Message* message) { | 440 bool SyncChannel::Send(Message* message) { |
441 #ifdef IPC_MESSAGE_LOG_ENABLED | 441 #ifdef IPC_MESSAGE_LOG_ENABLED |
442 Logging* logger = Logging::GetInstance(); | 442 Logging* logger = Logging::GetInstance(); |
443 std::string name; | 443 std::string name; |
444 logger->GetMessageText(message->type(), &name, message, NULL); | 444 logger->GetMessageText(message->type(), &name, message, NULL); |
445 TRACE_EVENT1("toplevel", "SyncChannel::Send", "name", name); | 445 TRACE_EVENT1("ipc", "SyncChannel::Send", "name", name); |
446 #else | 446 #else |
447 TRACE_EVENT2("toplevel", "SyncChannel::Send", | 447 TRACE_EVENT2("ipc", "SyncChannel::Send", |
448 "class", IPC_MESSAGE_ID_CLASS(message->type()), | 448 "class", IPC_MESSAGE_ID_CLASS(message->type()), |
449 "line", IPC_MESSAGE_ID_LINE(message->type())); | 449 "line", IPC_MESSAGE_ID_LINE(message->type())); |
450 #endif | 450 #endif |
451 if (!message->is_sync()) { | 451 if (!message->is_sync()) { |
452 ChannelProxy::Send(message); | 452 ChannelProxy::Send(message); |
453 return true; | 453 return true; |
454 } | 454 } |
455 | 455 |
456 // *this* might get deleted in WaitForReply. | 456 // *this* might get deleted in WaitForReply. |
457 scoped_refptr<SyncContext> context(sync_context()); | 457 scoped_refptr<SyncContext> context(sync_context()); |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // manual reset since the object watcher might otherwise reset the event | 556 // manual reset since the object watcher might otherwise reset the event |
557 // when we're doing a WaitMany. | 557 // when we're doing a WaitMany. |
558 dispatch_watcher_callback_ = | 558 dispatch_watcher_callback_ = |
559 base::Bind(&SyncChannel::OnWaitableEventSignaled, | 559 base::Bind(&SyncChannel::OnWaitableEventSignaled, |
560 base::Unretained(this)); | 560 base::Unretained(this)); |
561 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), | 561 dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), |
562 dispatch_watcher_callback_); | 562 dispatch_watcher_callback_); |
563 } | 563 } |
564 | 564 |
565 } // namespace IPC | 565 } // namespace IPC |
OLD | NEW |