Lines Matching refs:callback

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"
63 // |callback| must not be null.
64 explicit CancelableCallback(const base::Callback<void(void)>& callback)
66 callback_(callback) {
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(void)>& 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(void)>& callback() const {
133 // |callback| must not be null.
134 explicit CancelableCallback(const base::Callback<void(A1)>& callback)
136 callback_(callback) {
137 DCHECK(!callback.is_null());
143 // Cancels and drops the reference to the wrapped callback.
150 // Returns true if the wrapped callback has been cancelled.
155 // Sets |callback| as the closure that may be cancelled. |callback| may not
157 void Reset(const base::Callback<void(A1)>& callback) {
158 DCHECK(!callback.is_null());
166 callback_ = callback;
169 // Returns a callback that can be disabled by calling Cancel().
170 const base::Callback<void(A1)>& callback() const {
203 // |callback| must not be null.
204 explicit CancelableCallback(const base::Callback<void(A1, A2)>& callback)
206 callback_(callback) {
207 DCHECK(!callback.is_null());
213 // Cancels and drops the reference to the wrapped callback.
220 // Returns true if the wrapped callback has been cancelled.
225 // Sets |callback| as the closure that may be cancelled. |callback| may not
227 void Reset(const base::Callback<void(A1, A2)>& callback) {
228 DCHECK(!callback.is_null());
236 callback_ = callback;
239 // Returns a callback that can be disabled by calling Cancel().
240 const base::Callback<void(A1, A2)>& callback() const {