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

Unified Diff: ipc/ipc_channel_proxy.cc

Issue 8539036: base:Bind: Convert ipc/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Review fix. 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
« no previous file with comments | « no previous file | ipc/ipc_channel_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_channel_proxy.cc
diff --git a/ipc/ipc_channel_proxy.cc b/ipc/ipc_channel_proxy.cc
index 44933ae3d4cb19c40308dcdac59a5333c2fdcbb7..26d285a9f93c5405289e80ecdaaf523058cccb8f 100644
--- a/ipc/ipc_channel_proxy.cc
+++ b/ipc/ipc_channel_proxy.cc
@@ -2,6 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "base/bind.h"
#include "base/location.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
@@ -111,8 +112,8 @@ bool ChannelProxy::Context::OnMessageReceivedNoFilter(const Message& message) {
// this thread is active. That should be a reasonable assumption, but it
// feels risky. We may want to invent some more indirect way of referring to
// a MessageLoop if this becomes a problem.
- listener_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &Context::OnDispatchMessage, message));
+ listener_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&Context::OnDispatchMessage, this, message));
return true;
}
@@ -129,8 +130,8 @@ void ChannelProxy::Context::OnChannelConnected(int32 peer_pid) {
filters_[i]->OnChannelConnected(peer_pid);
// See above comment about using listener_message_loop_ here.
- listener_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &Context::OnDispatchConnected));
+ listener_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&Context::OnDispatchConnected, this));
}
// Called on the IPC::Channel thread
@@ -139,8 +140,8 @@ void ChannelProxy::Context::OnChannelError() {
filters_[i]->OnChannelError();
// See above comment about using listener_message_loop_ here.
- listener_message_loop_->PostTask(FROM_HERE, NewRunnableMethod(
- this, &Context::OnDispatchError));
+ listener_message_loop_->PostTask(
+ FROM_HERE, base::Bind(&Context::OnDispatchError, this));
}
// Called on the IPC::Channel thread
@@ -232,8 +233,7 @@ void ChannelProxy::Context::AddFilter(MessageFilter* filter) {
base::AutoLock auto_lock(pending_filters_lock_);
pending_filters_.push_back(make_scoped_refptr(filter));
ipc_message_loop_->PostTask(
- FROM_HERE,
- NewRunnableMethod(this, &Context::OnAddFilter));
+ FROM_HERE, base::Bind(&Context::OnAddFilter, this));
}
// Called on the listener's thread
@@ -324,13 +324,14 @@ void ChannelProxy::Init(const IPC::ChannelHandle& channel_handle,
// to connect and get an error since the pipe doesn't exist yet.
context_->CreateChannel(channel_handle, mode);
} else {
- context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- context_.get(), &Context::CreateChannel, channel_handle, mode));
+ context_->ipc_message_loop()->PostTask(
+ FROM_HERE, base::Bind(&Context::CreateChannel, context_.get(),
+ channel_handle, mode));
}
// complete initialization on the background thread
- context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- context_.get(), &Context::OnChannelOpened));
+ context_->ipc_message_loop()->PostTask(
+ FROM_HERE, base::Bind(&Context::OnChannelOpened, context_.get()));
}
void ChannelProxy::Close() {
@@ -340,8 +341,8 @@ void ChannelProxy::Close() {
context_->Clear();
if (context_->ipc_message_loop()) {
- context_->ipc_message_loop()->PostTask(FROM_HERE, NewRunnableMethod(
- context_.get(), &Context::OnChannelClosed));
+ context_->ipc_message_loop()->PostTask(
+ FROM_HERE, base::Bind(&Context::OnChannelClosed, context_.get()));
}
}
@@ -364,10 +365,8 @@ void ChannelProxy::AddFilter(MessageFilter* filter) {
void ChannelProxy::RemoveFilter(MessageFilter* filter) {
context_->ipc_message_loop()->PostTask(
- FROM_HERE, NewRunnableMethod(
- context_.get(),
- &Context::OnRemoveFilter,
- make_scoped_refptr(filter)));
+ FROM_HERE, base::Bind(&Context::OnRemoveFilter, context_.get(),
+ make_scoped_refptr(filter)));
}
void ChannelProxy::ClearIPCMessageLoop() {
« no previous file with comments | « no previous file | ipc/ipc_channel_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698