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 <stddef.h> | 7 #include <stddef.h> |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // We set the event in case the listener thread is blocked (or is about | 73 // We set the event in case the listener thread is blocked (or is about |
74 // to). In case it's not, the PostTask dispatches the messages. | 74 // to). In case it's not, the PostTask dispatches the messages. |
75 message_queue_.push_back(QueuedMessage(new Message(msg), context)); | 75 message_queue_.push_back(QueuedMessage(new Message(msg), context)); |
76 message_queue_version_++; | 76 message_queue_version_++; |
77 } | 77 } |
78 | 78 |
79 dispatch_event_.Signal(); | 79 dispatch_event_.Signal(); |
80 if (!was_task_pending) { | 80 if (!was_task_pending) { |
81 listener_task_runner_->PostTask( | 81 listener_task_runner_->PostTask( |
82 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchMessagesTask, | 82 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchMessagesTask, |
83 this, scoped_refptr<SyncContext>(context))); | 83 this, base::RetainedRef(context))); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
87 void QueueReply(const Message &msg, SyncChannel::SyncContext* context) { | 87 void QueueReply(const Message &msg, SyncChannel::SyncContext* context) { |
88 received_replies_.push_back(QueuedMessage(new Message(msg), context)); | 88 received_replies_.push_back(QueuedMessage(new Message(msg), context)); |
89 } | 89 } |
90 | 90 |
91 // Called on the listener's thread to process any queues synchronous | 91 // Called on the listener's thread to process any queues synchronous |
92 // messages. | 92 // messages. |
93 void DispatchMessagesTask(SyncContext* context) { | 93 void DispatchMessagesTask(SyncContext* context) { |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
596 | 596 |
597 void SyncChannel::OnChannelInit() { | 597 void SyncChannel::OnChannelInit() { |
598 for (const auto& filter : pre_init_sync_message_filters_) { | 598 for (const auto& filter : pre_init_sync_message_filters_) { |
599 filter->set_is_channel_send_thread_safe( | 599 filter->set_is_channel_send_thread_safe( |
600 context()->IsChannelSendThreadSafe()); | 600 context()->IsChannelSendThreadSafe()); |
601 } | 601 } |
602 pre_init_sync_message_filters_.clear(); | 602 pre_init_sync_message_filters_.clear(); |
603 } | 603 } |
604 | 604 |
605 } // namespace IPC | 605 } // namespace IPC |
OLD | NEW |