Home | History | Annotate | Download | only in base

Lines Matching refs:Callback

5 // CancelableCallback is a wrapper around base::Callback that allows
6 // cancellation of a callback. CancelableCallback takes a reference on the
7 // wrapped callback until this object is destroyed or Reset()/Cancel() are
13 // default-constructed state, i.e., CancelableCallback::callback() will return
14 // a null callback.
25 // Quit()s the message loop within 4 seconds. The cancelable callback is posted
27 // then the callback is cancelled.
35 // MessageLoop::current()->PostDelayedTask(FROM_HERE, timeout.callback(),
39 // timeout.Cancel(); // Hopefully this is hit before the timeout callback runs.
47 #include "base/callback.h"
64 // |callback| must not be null.
65 explicit CancelableCallback(const base::Callback<void(A...)>& callback)
66 : callback_(callback), weak_factory_(this) {
67 DCHECK(!callback.is_null());
73 // Cancels and drops the reference to the wrapped callback.
80 // Returns true if the wrapped callback has been cancelled.
85 // Sets |callback| as the closure that may be cancelled. |callback| may not
87 void Reset(const base::Callback<void(A...)>& callback) {
88 DCHECK(!callback.is_null());
96 callback_ = callback;
99 // Returns a callback that can be disabled by calling Cancel().
100 const base::Callback<void(A...)>& callback() const {
117 base::Callback<void(A...)> forwarder_;
120 base::Callback<void(A...)> callback_;