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 | 9 |
10 #include <utility> | 10 #include <utility> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 result = msg.send_result; | 366 result = msg.send_result; |
367 } | 367 } |
368 | 368 |
369 // We got a reply to a synchronous Send() call that's blocking the listener | 369 // We got a reply to a synchronous Send() call that's blocking the listener |
370 // thread. However, further down the call stack there could be another | 370 // thread. However, further down the call stack there could be another |
371 // blocking Send() call, whose reply we received after we made this last | 371 // blocking Send() call, whose reply we received after we made this last |
372 // Send() call. So check if we have any queued replies available that | 372 // Send() call. So check if we have any queued replies available that |
373 // can now unblock the listener thread. | 373 // can now unblock the listener thread. |
374 ipc_task_runner()->PostTask( | 374 ipc_task_runner()->PostTask( |
375 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchReplies, | 375 FROM_HERE, base::Bind(&ReceivedSyncMsgQueue::DispatchReplies, |
376 received_sync_msgs_.get())); | 376 received_sync_msgs_)); |
377 | 377 |
378 return result; | 378 return result; |
379 } | 379 } |
380 | 380 |
381 MojoEvent* SyncChannel::SyncContext::GetSendDoneEvent() { | 381 MojoEvent* SyncChannel::SyncContext::GetSendDoneEvent() { |
382 base::AutoLock auto_lock(deserializers_lock_); | 382 base::AutoLock auto_lock(deserializers_lock_); |
383 return deserializers_.back().done_event; | 383 return deserializers_.back().done_event; |
384 } | 384 } |
385 | 385 |
386 MojoEvent* SyncChannel::SyncContext::GetDispatchEvent() { | 386 MojoEvent* SyncChannel::SyncContext::GetDispatchEvent() { |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
700 | 700 |
701 void SyncChannel::OnChannelInit() { | 701 void SyncChannel::OnChannelInit() { |
702 for (const auto& filter : pre_init_sync_message_filters_) { | 702 for (const auto& filter : pre_init_sync_message_filters_) { |
703 filter->set_is_channel_send_thread_safe( | 703 filter->set_is_channel_send_thread_safe( |
704 context()->IsChannelSendThreadSafe()); | 704 context()->IsChannelSendThreadSafe()); |
705 } | 705 } |
706 pre_init_sync_message_filters_.clear(); | 706 pre_init_sync_message_filters_.clear(); |
707 } | 707 } |
708 | 708 |
709 } // namespace IPC | 709 } // namespace IPC |
OLD | NEW |