Remove calls to deprecated MessageLoop methods in remoting.
This CL makes the following replacements in
remoting:
Before After
----------------------------------------------------------
x.PostTask() x.task_runner()->PostTask()
PostDelayedTask() PostDelayedTask()
ReleaseSoon() ReleaseSoon()
DeleteSoon() DeleteSoon()
x->PostTask() y->task_runner()->PostTask()
PostDelayedTask() PostDelayedTask()
ReleaseSoon() ReleaseSoon()
DeleteSoon() DeleteSoon()
x.Run() RunLoop().Run()
x.RunUntilIdle() RunLoop().RunUntilIdle()
x->Run() RunLoop().Run()
x->RunUntilIdle() RunLoop().RunUntilIdle()
If |y| isn't MessageLoopForUI::current() or
MessageLoopForIO::current()
y.message_loop()->task_runner()
y.task_runner()
y->message_loop()->task_runner()
y->task_runner()
----------------------------------------------------------
|x| is a base::MessageLoop(ForUI|ForIO) or a pointer to
a base::MessageLoop(ForUI|ForIO). |y| is a base::Thread
or a pointer to a base::Thread.
This CL was generated using the MessageLoopDeprecatedMethods
clang-tidy fix available on the associated bug. Only files
that compile on Mac are affected. Follow-up CLs will make
these replacements for other platforms.
This CL doesn't change code behavior.
BUG=616447
[email protected]
Review-Url: https://codereview.chromium.org/2082363002
Cr-Commit-Position: refs/heads/master@{#401392}
diff --git a/remoting/base/auto_thread_unittest.cc b/remoting/base/auto_thread_unittest.cc
index 0faac34..5c72e351 100644
--- a/remoting/base/auto_thread_unittest.cc
+++ b/remoting/base/auto_thread_unittest.cc
@@ -5,7 +5,9 @@
#include "base/bind.h"
#include "base/files/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/run_loop.h"
#include "base/scoped_native_library.h"
+#include "base/single_thread_task_runner.h"
#include "build/build_config.h"
#include "remoting/base/auto_thread.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -67,10 +69,10 @@
// references created in tests are gone. We also post a delayed quit
// task to |message_loop_| so the test will not hang on failure.
main_task_runner_ = NULL;
- message_loop_.PostDelayedTask(FROM_HERE,
- base::MessageLoop::QuitWhenIdleClosure(),
- base::TimeDelta::FromSeconds(5));
- message_loop_.Run();
+ message_loop_.task_runner()->PostDelayedTask(
+ FROM_HERE, base::MessageLoop::QuitWhenIdleClosure(),
+ base::TimeDelta::FromSeconds(5));
+ base::RunLoop().Run();
}
void SetUp() override {
@@ -88,7 +90,8 @@
protected:
void QuitMainMessageLoop() {
message_loop_quit_correctly_ = true;
- message_loop_.PostTask(FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
+ message_loop_.task_runner()->PostTask(
+ FROM_HERE, base::MessageLoop::QuitWhenIdleClosure());
}
base::MessageLoop message_loop_;