Chromium Code Reviews| Index: jingle/glue/chrome_async_socket.cc |
| diff --git a/jingle/glue/chrome_async_socket.cc b/jingle/glue/chrome_async_socket.cc |
| index ca03a0fa722c5c3b9aee7b1feb0caf85d67f8aa9..ac669d0f3a5685a32dd8b7373cd38d2af5805f4c 100644 |
| --- a/jingle/glue/chrome_async_socket.cc |
| +++ b/jingle/glue/chrome_async_socket.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| #include "base/message_loop/message_loop.h" |
| +#include "base/single_thread_task_runner.h" |
| #include "jingle/glue/resolving_client_socket_factory.h" |
| #include "net/base/address_list.h" |
| #include "net/base/host_port_pair.h" |
| @@ -119,10 +120,9 @@ bool ChromeAsyncSocket::Connect(const rtc::SocketAddress& address) { |
| // the connect always happens asynchronously. |
| base::MessageLoop* message_loop = base::MessageLoop::current(); |
| CHECK(message_loop); |
| - message_loop->PostTask( |
| - FROM_HERE, |
| - base::Bind(&ChromeAsyncSocket::ProcessConnectDone, |
| - weak_ptr_factory_.GetWeakPtr(), status)); |
| + message_loop->task_runner()->PostTask( |
|
Sergey Ulanov
2016/06/22 17:42:29
Shouldn't this be ThreadTaskRunnerHandle::get()->P
fdoray
2016/06/22 17:48:06
Done. My script wasn't smart enough for this :)
|
| + FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessConnectDone, |
| + weak_ptr_factory_.GetWeakPtr(), status)); |
| } |
| return true; |
| } |
| @@ -156,10 +156,9 @@ void ChromeAsyncSocket::PostDoRead() { |
| DCHECK_EQ(read_end_, 0U); |
| base::MessageLoop* message_loop = base::MessageLoop::current(); |
| CHECK(message_loop); |
| - message_loop->PostTask( |
| + message_loop->task_runner()->PostTask( |
| FROM_HERE, |
| - base::Bind(&ChromeAsyncSocket::DoRead, |
| - weak_ptr_factory_.GetWeakPtr())); |
| + base::Bind(&ChromeAsyncSocket::DoRead, weak_ptr_factory_.GetWeakPtr())); |
| read_state_ = POSTED; |
| } |
| @@ -290,10 +289,9 @@ void ChromeAsyncSocket::PostDoWrite() { |
| DCHECK_GT(write_end_, 0U); |
| base::MessageLoop* message_loop = base::MessageLoop::current(); |
| CHECK(message_loop); |
| - message_loop->PostTask( |
| + message_loop->task_runner()->PostTask( |
| FROM_HERE, |
| - base::Bind(&ChromeAsyncSocket::DoWrite, |
| - weak_ptr_factory_.GetWeakPtr())); |
| + base::Bind(&ChromeAsyncSocket::DoWrite, weak_ptr_factory_.GetWeakPtr())); |
| write_state_ = POSTED; |
| } |
| @@ -413,10 +411,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) { |
| if (status != net::ERR_IO_PENDING) { |
| base::MessageLoop* message_loop = base::MessageLoop::current(); |
| CHECK(message_loop); |
| - message_loop->PostTask( |
| - FROM_HERE, |
| - base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, |
| - weak_ptr_factory_.GetWeakPtr(), status)); |
| + message_loop->task_runner()->PostTask( |
| + FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone, |
| + weak_ptr_factory_.GetWeakPtr(), status)); |
| } |
| return true; |
| } |