OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_CALLBACK_OLD_H_ | 5 #ifndef BASE_CALLBACK_OLD_H_ |
6 #define BASE_CALLBACK_OLD_H_ | 6 #define BASE_CALLBACK_OLD_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
| 9 #include "base/memory/raw_scoped_refptr_mismatch_checker.h" |
9 #include "base/tuple.h" | 10 #include "base/tuple.h" |
10 #include "base/raw_scoped_refptr_mismatch_checker.h" | |
11 | 11 |
12 // Callback -------------------------------------------------------------------- | 12 // Callback -------------------------------------------------------------------- |
13 // | 13 // |
14 // A Callback is like a Task but with unbound parameters. It is basically an | 14 // A Callback is like a Task but with unbound parameters. It is basically an |
15 // object-oriented function pointer. | 15 // object-oriented function pointer. |
16 // | 16 // |
17 // Callbacks are designed to work with Tuples. A set of helper functions and | 17 // Callbacks are designed to work with Tuples. A set of helper functions and |
18 // classes is provided to hide the Tuple details from the consumer. Client | 18 // classes is provided to hide the Tuple details from the consumer. Client |
19 // code will generally work with the CallbackRunner base class, which merely | 19 // code will generally work with the CallbackRunner base class, which merely |
20 // provides a Run method and is returned by the New* functions. This allows | 20 // provides a Run method and is returned by the New* functions. This allows |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 }; | 245 }; |
246 | 246 |
247 template <class T, typename ReturnValue> | 247 template <class T, typename ReturnValue> |
248 typename CallbackWithReturnValue<ReturnValue>::Type* | 248 typename CallbackWithReturnValue<ReturnValue>::Type* |
249 NewCallbackWithReturnValue(T* object, ReturnValue (T::*method)()) { | 249 NewCallbackWithReturnValue(T* object, ReturnValue (T::*method)()) { |
250 return new CallbackWithReturnValueImpl<T, ReturnValue (T::*)(), ReturnValue>( | 250 return new CallbackWithReturnValueImpl<T, ReturnValue (T::*)(), ReturnValue>( |
251 object, method); | 251 object, method); |
252 } | 252 } |
253 | 253 |
254 #endif // BASE_CALLBACK_OLD_H_ | 254 #endif // BASE_CALLBACK_OLD_H_ |
OLD | NEW |