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

Unified Diff: base/message_loop/message_pump_libevent_unittest.cc

Issue 2375663002: Replace MessageLoop::current()->task_runner() with ThreadTaskRunnerHandle::Get(). (Closed)
Patch Set: rebase Created 4 years, 3 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
Index: base/message_loop/message_pump_libevent_unittest.cc
diff --git a/base/message_loop/message_pump_libevent_unittest.cc b/base/message_loop/message_pump_libevent_unittest.cc
index 4164b3a7e49ff8e4971d62c07874a648d8f06fd2..a23b3543f3d25ade396ae62334a2d3c19b214920 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -21,6 +21,7 @@
#include "base/test/gtest_util.h"
#include "base/third_party/libevent/event.h"
#include "base/threading/thread.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -174,8 +175,7 @@ void QuitMessageLoopAndStart(const Closure& quit_closure) {
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
RunLoop runloop;
- MessageLoop::current()->task_runner()->PostTask(FROM_HERE,
- runloop.QuitClosure());
+ ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, runloop.QuitClosure());
runloop.Run();
}
@@ -186,7 +186,7 @@ class NestedPumpWatcher : public MessagePumpLibevent::Watcher {
void OnFileCanReadWithoutBlocking(int /* fd */) override {
RunLoop runloop;
- MessageLoop::current()->task_runner()->PostTask(
+ ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, Bind(&QuitMessageLoopAndStart, runloop.QuitClosure()));
runloop.Run();
}
@@ -218,8 +218,7 @@ class QuitWatcher : public BaseWatcher {
void OnFileCanReadWithoutBlocking(int /* fd */) override {
// Post a fatal closure to the MessageLoop before we quit it.
- MessageLoop::current()->task_runner()->PostTask(FROM_HERE,
- Bind(&FatalClosure));
+ ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE, Bind(&FatalClosure));
// Now quit the MessageLoop.
run_loop_->Quit();
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | chrome/browser/chromeos/login/easy_unlock/easy_unlock_reauth.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698