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

Unified Diff: base/synchronization/waitable_event_watcher_unittest.cc

Issue 2801593002: Convert WaitableEvent::EventCallback to OnceCallback (Closed)
Patch Set: +#include <utility> Created 3 years, 8 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/synchronization/waitable_event_watcher_unittest.cc
diff --git a/base/synchronization/waitable_event_watcher_unittest.cc b/base/synchronization/waitable_event_watcher_unittest.cc
index fcb4257d6df218b5a14b81f954fbf7f7b73201b6..9df72892c3c3813adf8d1286c7bdf6dfefe48930 100644
--- a/base/synchronization/waitable_event_watcher_unittest.cc
+++ b/base/synchronization/waitable_event_watcher_unittest.cc
@@ -52,7 +52,7 @@ void RunTest_BasicSignal(MessageLoop::Type message_loop_type) {
WaitableEvent::InitialState::NOT_SIGNALED);
WaitableEventWatcher watcher;
- watcher.StartWatching(&event, Bind(&QuitWhenSignaled));
+ watcher.StartWatching(&event, BindOnce(&QuitWhenSignaled));
event.Signal();
@@ -68,7 +68,7 @@ void RunTest_BasicCancel(MessageLoop::Type message_loop_type) {
WaitableEventWatcher watcher;
- watcher.StartWatching(&event, Bind(&QuitWhenSignaled));
+ watcher.StartWatching(&event, BindOnce(&QuitWhenSignaled));
watcher.StopWatching();
}
@@ -84,10 +84,9 @@ void RunTest_CancelAfterSet(MessageLoop::Type message_loop_type) {
int counter = 1;
DecrementCountContainer delegate(&counter);
- WaitableEventWatcher::EventCallback callback =
- Bind(&DecrementCountContainer::OnWaitableEventSignaled,
- Unretained(&delegate));
- watcher.StartWatching(&event, callback);
+ WaitableEventWatcher::EventCallback callback = BindOnce(
+ &DecrementCountContainer::OnWaitableEventSignaled, Unretained(&delegate));
+ watcher.StartWatching(&event, std::move(callback));
event.Signal();
@@ -113,7 +112,7 @@ void RunTest_OutlivesMessageLoop(MessageLoop::Type message_loop_type) {
{
MessageLoop message_loop(message_loop_type);
- watcher.StartWatching(&event, Bind(&QuitWhenSignaled));
+ watcher.StartWatching(&event, BindOnce(&QuitWhenSignaled));
}
}
}
@@ -131,7 +130,7 @@ void RunTest_DeleteUnder(MessageLoop::Type message_loop_type) {
new WaitableEvent(WaitableEvent::ResetPolicy::AUTOMATIC,
WaitableEvent::InitialState::NOT_SIGNALED);
- watcher.StartWatching(event, Bind(&QuitWhenSignaled));
+ watcher.StartWatching(event, BindOnce(&QuitWhenSignaled));
delete event;
}
}
« no previous file with comments | « base/synchronization/waitable_event_watcher_posix.cc ('k') | base/synchronization/waitable_event_watcher_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698