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

Unified Diff: base/synchronization/waitable_event_watcher.h

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.h
diff --git a/base/synchronization/waitable_event_watcher.h b/base/synchronization/waitable_event_watcher.h
index 44ef5047edfebcb0160b7cbc397750045676d0d9..4c83e21b289c7e2634a18f954cb635edd31f5357 100644
--- a/base/synchronization/waitable_event_watcher.h
+++ b/base/synchronization/waitable_event_watcher.h
@@ -35,7 +35,7 @@ class WaitableEvent;
// public:
// void DoStuffWhenSignaled(WaitableEvent *waitable_event) {
// watcher_.StartWatching(waitable_event,
-// base::Bind(&MyClass::OnWaitableEventSignaled, this);
+// base::BindOnce(&MyClass::OnWaitableEventSignaled, this);
// }
// private:
// void OnWaitableEventSignaled(WaitableEvent* waitable_event) {
@@ -64,7 +64,7 @@ class BASE_EXPORT WaitableEventWatcher
#endif
{
public:
- typedef Callback<void(WaitableEvent*)> EventCallback;
+ using EventCallback = OnceCallback<void(WaitableEvent*)>;
WaitableEventWatcher();
#if defined(OS_WIN)
@@ -75,7 +75,7 @@ class BASE_EXPORT WaitableEventWatcher
// When |event| is signaled, |callback| is called on the sequence that called
// StartWatching().
- bool StartWatching(WaitableEvent* event, const EventCallback& callback);
+ bool StartWatching(WaitableEvent* event, EventCallback callback);
// Cancel the current watch. Must be called from the same sequence which
// started the watch.
« no previous file with comments | « base/message_loop/message_pump_libevent_unittest.cc ('k') | base/synchronization/waitable_event_watcher_posix.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698