summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_sync_channel.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 18:00:49 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-02 18:00:49 +0000
commit92bf906d13ba00204d3f2fc338340ccc670ed545 (patch)
tree28a8803d9a9a0810d2f9d93576d20d1cdf4d63b6 /ipc/ipc_sync_channel.cc
parent68a008e82da08b0bf7d421049f0a292b99b88048 (diff)
downloadchromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.zip
chromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.tar.gz
chromium_src-92bf906d13ba00204d3f2fc338340ccc670ed545.tar.bz2
Switch IPC::ChannelProxy to use MessageLoopProxy instead of MessageLoop. This allows us to remove usage of the IOThread object, and generally makes IPC::ChannelProxy more robust for future uses.
Review URL: http://codereview.chromium.org/6901146 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83741 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ipc/ipc_sync_channel.cc')
-rw-r--r--ipc/ipc_sync_channel.cc13
1 files changed, 7 insertions, 6 deletions
diff --git a/ipc/ipc_sync_channel.cc b/ipc/ipc_sync_channel.cc
index 97e1c18..f3a6a47 100644
--- a/ipc/ipc_sync_channel.cc
+++ b/ipc/ipc_sync_channel.cc
@@ -6,7 +6,6 @@
#include "base/lazy_instance.h"
#include "base/logging.h"
-#include "base/message_loop.h"
#include "base/threading/thread_local.h"
#include "base/synchronization/waitable_event.h"
#include "base/synchronization/waitable_event_watcher.h"
@@ -134,7 +133,9 @@ class SyncChannel::ReceivedSyncMsgQueue :
}
WaitableEvent* dispatch_event() { return &dispatch_event_; }
- MessageLoop* listener_message_loop() { return listener_message_loop_; }
+ base::MessageLoopProxy* listener_message_loop() {
+ return listener_message_loop_;
+ }
// Holds a pointer to the per-thread ReceivedSyncMsgQueue object.
static base::LazyInstance<base::ThreadLocalPointer<ReceivedSyncMsgQueue> >
@@ -168,7 +169,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
// as manual reset.
ReceivedSyncMsgQueue() :
dispatch_event_(true, false),
- listener_message_loop_(MessageLoop::current()),
+ listener_message_loop_(base::MessageLoopProxy::CreateForCurrentThread()),
task_pending_(false),
listener_count_(0),
top_send_done_watcher_(NULL) {
@@ -192,7 +193,7 @@ class SyncChannel::ReceivedSyncMsgQueue :
// sender needs its reply before it can reply to our original synchronous
// message.
WaitableEvent dispatch_event_;
- MessageLoop* listener_message_loop_;
+ scoped_refptr<base::MessageLoopProxy> listener_message_loop_;
base::Lock message_lock_;
bool task_pending_;
int listener_count_;
@@ -208,7 +209,7 @@ base::LazyInstance<base::ThreadLocalPointer<SyncChannel::ReceivedSyncMsgQueue> >
SyncChannel::SyncContext::SyncContext(
Channel::Listener* listener,
- MessageLoop* ipc_thread,
+ base::MessageLoopProxy* ipc_thread,
WaitableEvent* shutdown_event)
: ChannelProxy::Context(listener, ipc_thread),
received_sync_msgs_(ReceivedSyncMsgQueue::AddContext()),
@@ -371,7 +372,7 @@ SyncChannel::SyncChannel(
const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Channel::Listener* listener,
- MessageLoop* ipc_message_loop,
+ base::MessageLoopProxy* ipc_message_loop,
bool create_pipe_now,
WaitableEvent* shutdown_event)
: ChannelProxy(