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; |
} |