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

Unified Diff: jingle/glue/chrome_async_socket.cc

Issue 2082353002: Remove calls to deprecated MessageLoop methods in jingle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use ThreadTaskRunnerHandle Created 4 years, 6 months 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 | jingle/glue/proxy_resolving_client_socket_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..cd95cdc4c8582d57e59b98413f3c502d85e2bed8 100644
--- a/jingle/glue/chrome_async_socket.cc
+++ b/jingle/glue/chrome_async_socket.cc
@@ -13,7 +13,7 @@
#include "base/bind.h"
#include "base/compiler_specific.h"
#include "base/logging.h"
-#include "base/message_loop/message_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "jingle/glue/resolving_client_socket_factory.h"
#include "net/base/address_list.h"
#include "net/base/host_port_pair.h"
@@ -117,12 +117,9 @@ bool ChromeAsyncSocket::Connect(const rtc::SocketAddress& address) {
// directly here as the caller may not expect an error/close to
// happen here. This is okay, as 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(
- FROM_HERE,
- base::Bind(&ChromeAsyncSocket::ProcessConnectDone,
- weak_ptr_factory_.GetWeakPtr(), status));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessConnectDone,
+ weak_ptr_factory_.GetWeakPtr(), status));
}
return true;
}
@@ -154,12 +151,9 @@ void ChromeAsyncSocket::PostDoRead() {
DCHECK_EQ(read_state_, IDLE);
DCHECK_EQ(read_start_, 0U);
DCHECK_EQ(read_end_, 0U);
- base::MessageLoop* message_loop = base::MessageLoop::current();
- CHECK(message_loop);
- message_loop->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::Bind(&ChromeAsyncSocket::DoRead,
- weak_ptr_factory_.GetWeakPtr()));
+ base::Bind(&ChromeAsyncSocket::DoRead, weak_ptr_factory_.GetWeakPtr()));
read_state_ = POSTED;
}
@@ -288,12 +282,9 @@ void ChromeAsyncSocket::PostDoWrite() {
DCHECK(IsOpen());
DCHECK_EQ(write_state_, IDLE);
DCHECK_GT(write_end_, 0U);
- base::MessageLoop* message_loop = base::MessageLoop::current();
- CHECK(message_loop);
- message_loop->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::Bind(&ChromeAsyncSocket::DoWrite,
- weak_ptr_factory_.GetWeakPtr()));
+ base::Bind(&ChromeAsyncSocket::DoWrite, weak_ptr_factory_.GetWeakPtr()));
write_state_ = POSTED;
}
@@ -411,12 +402,9 @@ bool ChromeAsyncSocket::StartTls(const std::string& domain_name) {
base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
weak_ptr_factory_.GetWeakPtr()));
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));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&ChromeAsyncSocket::ProcessSSLConnectDone,
+ weak_ptr_factory_.GetWeakPtr(), status));
}
return true;
}
« no previous file with comments | « no previous file | jingle/glue/proxy_resolving_client_socket_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698