Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(253)

Unified Diff: ipc/ipc_sync_channel.cc

Issue 8417054: Allow proxy channels to be created without initializing the underlying channel. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698