summaryrefslogtreecommitdiffstats
path: root/ipc/ipc_channel_proxy.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_channel_proxy.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_channel_proxy.cc')
-rw-r--r--ipc/ipc_channel_proxy.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index c219829..8f981f4 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -4,7 +4,6 @@
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
-#include "base/message_loop.h"
#include "ipc/ipc_channel_proxy.h"
#include "ipc/ipc_logging.h"
#include "ipc/ipc_message_utils.h"
@@ -60,14 +59,17 @@ void ChannelProxy::MessageFilter::OnDestruct() const {
//------------------------------------------------------------------------------
ChannelProxy::Context::Context(Channel::Listener* listener,
- MessageLoop* ipc_message_loop)
- : listener_message_loop_(MessageLoop::current()),
+ base::MessageLoopProxy* ipc_message_loop)
+ : listener_message_loop_(base::MessageLoopProxy::CreateForCurrentThread()),
listener_(listener),
ipc_message_loop_(ipc_message_loop),
peer_pid_(0),
channel_connected_called_(false) {
}
+ChannelProxy::Context::~Context() {
+}
+
void ChannelProxy::Context::CreateChannel(const IPC::ChannelHandle& handle,
const Channel::Mode& mode) {
DCHECK(channel_.get() == NULL);
@@ -280,14 +282,14 @@ void ChannelProxy::Context::OnDispatchError() {
ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
Channel::Listener* listener,
- MessageLoop* ipc_thread)
+ base::MessageLoopProxy* ipc_thread)
: context_(new Context(listener, ipc_thread)) {
Init(channel_handle, mode, ipc_thread, true);
}
ChannelProxy::ChannelProxy(const IPC::ChannelHandle& channel_handle,
Channel::Mode mode,
- MessageLoop* ipc_thread,
+ base::MessageLoopProxy* ipc_thread,
Context* context,
bool create_pipe_now)
: context_(context) {
@@ -299,7 +301,8 @@ ChannelProxy::~ChannelProxy() {
}
void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
- Channel::Mode mode, MessageLoop* ipc_thread_loop,
+ Channel::Mode mode,
+ base::MessageLoopProxy* ipc_thread_loop,
bool create_pipe_now) {
#if defined(OS_POSIX)
// When we are creating a server on POSIX, we need its file descriptor