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.
49 #include "base/callback.h"
66 // |callback| must not be null.
67 explicit CancelableCallback(const base::Callback<void(A...)>& callback)
68 : callback_(callback), weak_factory_(this) {
69 DCHECK(!callback.is_null());
75 // Cancels and drops the reference to the wrapped callback.
82 // Returns true if the wrapped callback has been cancelled.
87 // Sets |callback| as the closure that may be cancelled. |callback| may not
89 void Reset(const base::Callback<void(A...)>& callback) {
90 DCHECK(!callback.is_null());
98 callback_ = callback;
101 // Returns a callback that can be disabled by calling Cancel().
102 const base::Callback<void(A...)>& callback() const {
119 base::Callback<void(A...)> forwarder_;
122 base::Callback<void(A...)> callback_;