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

Unified Diff: remoting/protocol/connection_tester.cc

Issue 2104363004: Remove remaining calls to deprecated MessageLoop methods. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR gab Created 4 years, 5 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 | « remoting/protocol/connection_tester.h ('k') | remoting/protocol/monitored_video_stub_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: remoting/protocol/connection_tester.cc
diff --git a/remoting/protocol/connection_tester.cc b/remoting/protocol/connection_tester.cc
index 89389b098c25a0bb7faf040f71ac6183c64846e6..1089e3145843c015f86d827cc6330fe81277c1b7 100644
--- a/remoting/protocol/connection_tester.cc
+++ b/remoting/protocol/connection_tester.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/message_loop/message_loop.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "net/base/io_buffer.h"
#include "net/base/net_errors.h"
#include "remoting/proto/video.pb.h"
@@ -22,15 +23,14 @@ StreamConnectionTester::StreamConnectionTester(P2PStreamSocket* client_socket,
P2PStreamSocket* host_socket,
int message_size,
int message_count)
- : message_loop_(base::MessageLoop::current()),
+ : task_runner_(base::ThreadTaskRunnerHandle::Get()),
host_socket_(host_socket),
client_socket_(client_socket),
message_size_(message_size),
test_data_size_(message_size * message_count),
done_(false),
write_errors_(0),
- read_errors_(0) {
-}
+ read_errors_(0) {}
StreamConnectionTester::~StreamConnectionTester() {
}
@@ -56,7 +56,7 @@ void StreamConnectionTester::CheckResults() {
void StreamConnectionTester::Done() {
done_ = true;
- message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ task_runner_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
void StreamConnectionTester::InitBuffers() {
@@ -137,7 +137,7 @@ DatagramConnectionTester::DatagramConnectionTester(
int message_size,
int message_count,
int delay_ms)
- : message_loop_(base::MessageLoop::current()),
+ : task_runner_(base::ThreadTaskRunnerHandle::Get()),
host_socket_(host_socket),
client_socket_(client_socket),
message_size_(message_size),
@@ -174,7 +174,7 @@ void DatagramConnectionTester::CheckResults() {
void DatagramConnectionTester::Done() {
done_ = true;
- message_loop_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ task_runner_->PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
void DatagramConnectionTester::DoWrite() {
@@ -209,7 +209,7 @@ void DatagramConnectionTester::HandleWriteResult(int result) {
} else if (result > 0) {
EXPECT_EQ(message_size_, result);
packets_sent_++;
- message_loop_->PostDelayedTask(
+ task_runner_->PostDelayedTask(
FROM_HERE,
base::Bind(&DatagramConnectionTester::DoWrite, base::Unretained(this)),
base::TimeDelta::FromMilliseconds(delay_ms_));
« no previous file with comments | « remoting/protocol/connection_tester.h ('k') | remoting/protocol/monitored_video_stub_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698