Commit ba20f3c9 authored by Carlos Caballero's avatar Carlos Caballero Committed by Commit Bot

Remove references to MessageLoopForIO in /remoting

MessageLoopForIO is going away soon. Use SingleThreadTaskExecutor
instead.

This CL was uploaded by git cl split.

R=lambroslambrou@chromium.org

Bug: 891670
Change-Id: Id1c49577b98d4adc705d1eec6a164382fb5aba77
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1731848
Auto-Submit: Carlos Caballero <carlscab@google.com>
Commit-Queue: Lambros Lambrou <lambroslambrou@chromium.org>
Reviewed-by: default avatarLambros Lambrou <lambroslambrou@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683676}
parent 91c4e209
......@@ -9,10 +9,11 @@
#include "base/bind.h"
#include "base/logging.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/message_loop/message_pump_type.h"
#include "base/run_loop.h"
#include "base/strings/stringprintf.h"
#include "base/task/single_thread_task_executor.h"
#include "remoting/test/access_token_fetcher.h"
#include "remoting/test/host_list_fetcher.h"
#include "remoting/test/test_token_storage.h"
......@@ -49,7 +50,8 @@ bool ChromotingTestDriverEnvironment::Initialize(
}
if (!base::MessageLoopCurrent::Get()) {
message_loop_.reset(new base::MessageLoopForIO);
executor_ = std::make_unique<base::SingleThreadTaskExecutor>(
base::MessagePumpType::IO);
}
// If a unit test has set |test_test_token_storage_| then we should use it
......@@ -199,7 +201,7 @@ void ChromotingTestDriverEnvironment::TearDown() {
// registered AtExitManager. The AtExitManager is torn down before the test
// destructor is executed, so we tear down the MessageLoop here, while it is
// still valid.
message_loop_.reset();
executor_.reset();
}
bool ChromotingTestDriverEnvironment::RetrieveAccessToken(
......
......@@ -16,7 +16,7 @@
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
class MessageLoopForIO;
class SingleThreadTaskExecutor;
}
namespace remoting {
......@@ -147,7 +147,7 @@ class ChromotingTestDriverEnvironment : public testing::Environment {
remoting::test::HostListFetcher* test_host_list_fetcher_ = nullptr;
// Used for running network request tasks.
std::unique_ptr<base::MessageLoopForIO> message_loop_;
std::unique_ptr<base::SingleThreadTaskExecutor> executor_;
DISALLOW_COPY_AND_ASSIGN(ChromotingTestDriverEnvironment);
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment