Index: ipc/ipc_sync_channel.cc |
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc |
index 8fe5c3781272b95db90d26ef19f24be64914980d..53130857dcff85f38bc186462dffa9642be0dff1 100644 |
--- a/ipc/ipc_sync_channel.cc |
+++ b/ipc/ipc_sync_channel.cc |
@@ -376,10 +376,23 @@ SyncChannel::SyncChannel( |
base::MessageLoopProxy* ipc_message_loop, |
bool create_pipe_now, |
WaitableEvent* shutdown_event) |
- : ChannelProxy( |
- channel_handle, mode, ipc_message_loop, |
- new SyncContext(listener, ipc_message_loop, shutdown_event), |
- create_pipe_now), |
+ : ChannelProxy(new SyncContext(listener, ipc_message_loop, shutdown_event)), |
+ sync_messages_with_no_timeout_allowed_(true) { |
+ Init(channel_handle, mode, create_pipe_now); |
+ // Ideally we only want to watch this object when running a nested message |
+ // loop. However, we don't know when it exits if there's another nested |
+ // message loop running under it or not, so we wouldn't know whether to |
dmac
2011/11/04 22:30:44
would be nice to get rid of this duplicated code b
kkania
2011/11/07 20:25:16
Done.
|
+ // stop or keep watching. So we always watch it, and create the event as |
+ // manual reset since the object watcher might otherwise reset the event |
+ // when we're doing a WaitMany. |
+ dispatch_watcher_.StartWatching(sync_context()->GetDispatchEvent(), this); |
+} |
+ |
+SyncChannel::SyncChannel( |
+ Channel::Listener* listener, |
+ base::MessageLoopProxy* ipc_message_loop, |
+ WaitableEvent* shutdown_event) |
+ : ChannelProxy(new SyncContext(listener, ipc_message_loop, shutdown_event)), |
sync_messages_with_no_timeout_allowed_(true) { |
// Ideally we only want to watch this object when running a nested message |
// loop. However, we don't know when it exits if there's another nested |