Chromium Code Reviews| Index: jingle/glue/proxy_resolving_client_socket.cc |
| diff --git a/jingle/glue/proxy_resolving_client_socket.cc b/jingle/glue/proxy_resolving_client_socket.cc |
| index 9e3e61350608f235b265c03cd14b80ec8dc2e0be..cb996b09a6e1af79bf2a6a5d7c43adfc8dcf3616 100644 |
| --- a/jingle/glue/proxy_resolving_client_socket.cc |
| +++ b/jingle/glue/proxy_resolving_client_socket.cc |
| @@ -11,6 +11,7 @@ |
| #include "base/bind_helpers.h" |
| #include "base/compiler_specific.h" |
| #include "base/logging.h" |
| +#include "base/threading/thread_task_runner_handle.h" |
| #include "net/base/io_buffer.h" |
| #include "net/base/ip_address.h" |
| #include "net/base/load_flags.h" |
| @@ -149,9 +150,8 @@ int ProxyResolvingClientSocket::Connect( |
| // We defer execution of ProcessProxyResolveDone instead of calling it |
| // directly here for simplicity. From the caller's point of view, |
| // the connect always happens asynchronously. |
| - base::MessageLoop* message_loop = base::MessageLoop::current(); |
| - CHECK(message_loop); |
| - message_loop->PostTask( |
| + CHECK(base::ThreadTaskRunnerHandle::IsSet()); |
|
Sergey Ulanov
2016/06/20 22:53:25
I don't think you need this CHECK(). There is DCHE
fdoray
2016/06/21 13:01:51
Done. I didn't want to replace a CHECK with a DCHE
|
| + base::ThreadTaskRunnerHandle::Get()->PostTask( |
| FROM_HERE, |
| base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone, |
| weak_factory_.GetWeakPtr(), status)); |
| @@ -305,9 +305,8 @@ int ProxyResolvingClientSocket::ReconsiderProxyAfterError(int error) { |
| // In both cases we want to post ProcessProxyResolveDone (in the error case |
| // we might still want to fall back a direct connection). |
| if (rv != net::ERR_IO_PENDING) { |
| - base::MessageLoop* message_loop = base::MessageLoop::current(); |
| - CHECK(message_loop); |
| - message_loop->PostTask( |
| + CHECK(base::ThreadTaskRunnerHandle::IsSet()); |
| + base::ThreadTaskRunnerHandle::Get()->PostTask( |
| FROM_HERE, |
| base::Bind(&ProxyResolvingClientSocket::ProcessProxyResolveDone, |
| weak_factory_.GetWeakPtr(), rv)); |