| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/thread_local.h" | 9 #include "base/thread_local.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 343 } |
| 344 | 344 |
| 345 void SyncChannel::SyncContext::OnWaitableEventSignaled(WaitableEvent* event) { | 345 void SyncChannel::SyncContext::OnWaitableEventSignaled(WaitableEvent* event) { |
| 346 if (event == shutdown_event_) { | 346 if (event == shutdown_event_) { |
| 347 // Process shut down before we can get a reply to a synchronous message. | 347 // Process shut down before we can get a reply to a synchronous message. |
| 348 // Cancel pending Send calls, which will end up setting the send done event. | 348 // Cancel pending Send calls, which will end up setting the send done event. |
| 349 CancelPendingSends(); | 349 CancelPendingSends(); |
| 350 } else { | 350 } else { |
| 351 // We got the reply, timed out or the process shutdown. | 351 // We got the reply, timed out or the process shutdown. |
| 352 DCHECK(event == GetSendDoneEvent()); | 352 DCHECK(event == GetSendDoneEvent()); |
| 353 MessageLoop::current()->Quit(); | 353 MessageLoop::current()->QuitNow(); |
| 354 } | 354 } |
| 355 } | 355 } |
| 356 | 356 |
| 357 | 357 |
| 358 SyncChannel::SyncChannel( | 358 SyncChannel::SyncChannel( |
| 359 const std::string& channel_id, Channel::Mode mode, | 359 const std::string& channel_id, Channel::Mode mode, |
| 360 Channel::Listener* listener, MessageFilter* filter, | 360 Channel::Listener* listener, MessageFilter* filter, |
| 361 MessageLoop* ipc_message_loop, bool create_pipe_now, | 361 MessageLoop* ipc_message_loop, bool create_pipe_now, |
| 362 WaitableEvent* shutdown_event) | 362 WaitableEvent* shutdown_event) |
| 363 : ChannelProxy( | 363 : ChannelProxy( |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 484 void SyncChannel::OnWaitableEventSignaled(WaitableEvent* event) { | 484 void SyncChannel::OnWaitableEventSignaled(WaitableEvent* event) { |
| 485 DCHECK(event == sync_context()->GetDispatchEvent()); | 485 DCHECK(event == sync_context()->GetDispatchEvent()); |
| 486 // The call to DispatchMessages might delete this object, so reregister | 486 // The call to DispatchMessages might delete this object, so reregister |
| 487 // the object watcher first. | 487 // the object watcher first. |
| 488 event->Reset(); | 488 event->Reset(); |
| 489 dispatch_watcher_.StartWatching(event, this); | 489 dispatch_watcher_.StartWatching(event, this); |
| 490 sync_context()->DispatchMessages(); | 490 sync_context()->DispatchMessages(); |
| 491 } | 491 } |
| 492 | 492 |
| 493 } // namespace IPC | 493 } // namespace IPC |
| OLD | NEW |