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 656 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
667 | 667 |
668 if (dispatch) { | 668 if (dispatch) { |
669 // We're waiting for a reply, but we received a blocking synchronous call. | 669 // We're waiting for a reply, but we received a blocking synchronous call. |
670 // We must process it to avoid potential deadlocks. | 670 // We must process it to avoid potential deadlocks. |
671 context->GetDispatchEvent()->Reset(); | 671 context->GetDispatchEvent()->Reset(); |
672 context->DispatchMessages(); | 672 context->DispatchMessages(); |
673 continue; | 673 continue; |
674 } | 674 } |
675 | 675 |
676 if (should_pump_messages) | 676 if (should_pump_messages) |
677 WaitForReplyWithNestedMessageLoop(context); // Run a nested message loop. | 677 WaitForReplyWithNestedMessageLoop(context); // Run a nested run loop. |
678 | 678 |
679 break; | 679 break; |
680 } | 680 } |
681 } | 681 } |
682 | 682 |
683 void SyncChannel::WaitForReplyWithNestedMessageLoop(SyncContext* context) { | 683 void SyncChannel::WaitForReplyWithNestedMessageLoop(SyncContext* context) { |
684 base::MessageLoop::ScopedNestableTaskAllower allow( | 684 base::MessageLoop::ScopedNestableTaskAllower allow( |
685 base::MessageLoop::current()); | 685 base::MessageLoop::current()); |
686 base::RunLoop nested_loop; | 686 base::RunLoop nested_loop; |
687 ReceivedSyncMsgQueue::NestedSendDoneWatcher watcher(context, &nested_loop); | 687 ReceivedSyncMsgQueue::NestedSendDoneWatcher watcher(context, &nested_loop); |
(...skipping 19 matching lines...) Expand all Loading... |
707 sync_context()->GetDispatchEvent(), | 707 sync_context()->GetDispatchEvent(), |
708 base::Bind(&SyncChannel::OnDispatchEventSignaled, | 708 base::Bind(&SyncChannel::OnDispatchEventSignaled, |
709 base::Unretained(this))); | 709 base::Unretained(this))); |
710 } | 710 } |
711 | 711 |
712 void SyncChannel::OnChannelInit() { | 712 void SyncChannel::OnChannelInit() { |
713 pre_init_sync_message_filters_.clear(); | 713 pre_init_sync_message_filters_.clear(); |
714 } | 714 } |
715 | 715 |
716 } // namespace IPC | 716 } // namespace IPC |
OLD | NEW |