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

Unified Diff: content/common/webmessageportchannel_impl.cc

Issue 8556001: Convert NewRunnableFunction/NewRunnableMethod calls to use base::Bind(). (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
« no previous file with comments | « content/common/socket_stream_dispatcher.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/webmessageportchannel_impl.cc
diff --git a/content/common/webmessageportchannel_impl.cc b/content/common/webmessageportchannel_impl.cc
index 6a9ac365498fccc7dcce673f4e78552e853df271..f7b9489c0eb071011409e47ed2284156083a201c 100644
--- a/content/common/webmessageportchannel_impl.cc
+++ b/content/common/webmessageportchannel_impl.cc
@@ -4,6 +4,7 @@
#include "content/common/webmessageportchannel_impl.h"
+#include "base/bind.h"
#include "content/common/child_process.h"
#include "content/common/child_thread.h"
#include "content/common/worker_messages.h"
@@ -78,9 +79,10 @@ void WebMessagePortChannelImpl::postMessage(
const WebString& message,
WebMessagePortChannelArray* channels) {
if (MessageLoop::current() != ChildThread::current()->message_loop()) {
- ChildThread::current()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &WebMessagePortChannelImpl::postMessage,
- message, channels));
+ ChildThread::current()->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMessagePortChannelImpl::postMessage, this,
+ message, channels));
return;
}
@@ -124,8 +126,9 @@ bool WebMessagePortChannelImpl::tryGetMessage(
void WebMessagePortChannelImpl::Init() {
if (MessageLoop::current() != ChildThread::current()->message_loop()) {
- ChildThread::current()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &WebMessagePortChannelImpl::Init));
+ ChildThread::current()->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMessagePortChannelImpl::Init, this));
return;
}
@@ -141,8 +144,9 @@ void WebMessagePortChannelImpl::Init() {
void WebMessagePortChannelImpl::Entangle(
scoped_refptr<WebMessagePortChannelImpl> channel) {
if (MessageLoop::current() != ChildThread::current()->message_loop()) {
- ChildThread::current()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &WebMessagePortChannelImpl::Entangle, channel));
+ ChildThread::current()->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMessagePortChannelImpl::Entangle, this, channel));
return;
}
@@ -152,8 +156,9 @@ void WebMessagePortChannelImpl::Entangle(
void WebMessagePortChannelImpl::QueueMessages() {
if (MessageLoop::current() != ChildThread::current()->message_loop()) {
- ChildThread::current()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &WebMessagePortChannelImpl::QueueMessages));
+ ChildThread::current()->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMessagePortChannelImpl::QueueMessages, this));
return;
}
// This message port is being sent elsewhere (perhaps to another process).
@@ -172,8 +177,9 @@ void WebMessagePortChannelImpl::QueueMessages() {
void WebMessagePortChannelImpl::Send(IPC::Message* message) {
if (MessageLoop::current() != ChildThread::current()->message_loop()) {
DCHECK(!message->is_sync());
- ChildThread::current()->message_loop()->PostTask(FROM_HERE,
- NewRunnableMethod(this, &WebMessagePortChannelImpl::Send, message));
+ ChildThread::current()->message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&WebMessagePortChannelImpl::Send, this, message));
return;
}
« no previous file with comments | « content/common/socket_stream_dispatcher.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698