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

Unified Diff: base/message_loop/message_pump_libevent_unittest.cc

Issue 2103333006: Remove calls to deprecated MessageLoop methods in base. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 | « base/message_loop/message_loop_unittest.cc ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6a5a1f36235786cba27857dadb23a18ce3da3e86..6d1cf7ef31f9a9ab55da3de7730148bb8de4aacb 100644
--- a/base/message_loop/message_pump_libevent_unittest.cc
+++ b/base/message_loop/message_pump_libevent_unittest.cc
@@ -15,6 +15,7 @@
#include "base/message_loop/message_loop.h"
#include "base/posix/eintr_wrapper.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
#include "base/synchronization/waitable_event_watcher.h"
#include "base/third_party/libevent/event.h"
@@ -177,7 +178,8 @@ void QuitMessageLoopAndStart(const Closure& quit_closure) {
MessageLoop::ScopedNestableTaskAllower allow(MessageLoop::current());
RunLoop runloop;
- MessageLoop::current()->PostTask(FROM_HERE, runloop.QuitClosure());
+ MessageLoop::current()->task_runner()->PostTask(FROM_HERE,
+ runloop.QuitClosure());
runloop.Run();
}
@@ -188,8 +190,8 @@ class NestedPumpWatcher : public MessagePumpLibevent::Watcher {
void OnFileCanReadWithoutBlocking(int /* fd */) override {
RunLoop runloop;
- MessageLoop::current()->PostTask(FROM_HERE, Bind(&QuitMessageLoopAndStart,
- runloop.QuitClosure()));
+ MessageLoop::current()->task_runner()->PostTask(
+ FROM_HERE, Bind(&QuitMessageLoopAndStart, runloop.QuitClosure()));
runloop.Run();
}
@@ -220,7 +222,8 @@ class QuitWatcher : public BaseWatcher {
void OnFileCanReadWithoutBlocking(int /* fd */) override {
// Post a fatal closure to the MessageLoop before we quit it.
- MessageLoop::current()->PostTask(FROM_HERE, Bind(&FatalClosure));
+ MessageLoop::current()->task_runner()->PostTask(FROM_HERE,
+ Bind(&FatalClosure));
// Now quit the MessageLoop.
run_loop_->Quit();
@@ -260,19 +263,21 @@ TEST_F(MessagePumpLibeventTest, QuitWatcher) {
const char buf = 0;
const WaitableEventWatcher::EventCallback write_fd_task =
Bind(&WriteFDWrapper, pipefds_[1], &buf, 1);
- io_loop()->PostTask(FROM_HERE,
- Bind(IgnoreResult(&WaitableEventWatcher::StartWatching),
- Unretained(watcher.get()), &event, write_fd_task));
+ io_loop()->task_runner()->PostTask(
+ FROM_HERE, Bind(IgnoreResult(&WaitableEventWatcher::StartWatching),
+ Unretained(watcher.get()), &event, write_fd_task));
// Queue |event| to signal on |loop|.
- loop.PostTask(FROM_HERE, Bind(&WaitableEvent::Signal, Unretained(&event)));
+ loop.task_runner()->PostTask(
+ FROM_HERE, Bind(&WaitableEvent::Signal, Unretained(&event)));
// Now run the MessageLoop.
run_loop.Run();
// StartWatching can move |watcher| to IO thread. Release on IO thread.
- io_loop()->PostTask(FROM_HERE, Bind(&WaitableEventWatcher::StopWatching,
- Owned(watcher.release())));
+ io_loop()->task_runner()->PostTask(
+ FROM_HERE,
+ Bind(&WaitableEventWatcher::StopWatching, Owned(watcher.release())));
}
} // namespace
« no previous file with comments | « base/message_loop/message_loop_unittest.cc ('k') | base/message_loop/message_pump_perftest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698