OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // This file contains utility functions and classes that help the | 5 // This file contains utility functions and classes that help the |
6 // implementation, and management of the Callback objects. | 6 // implementation, and management of the Callback objects. |
7 | 7 |
8 #ifndef BASE_CALLBACK_INTERNAL_H_ | 8 #ifndef BASE_CALLBACK_INTERNAL_H_ |
9 #define BASE_CALLBACK_INTERNAL_H_ | 9 #define BASE_CALLBACK_INTERNAL_H_ |
10 | 10 |
11 #include <stddef.h> | 11 #include <stddef.h> |
12 | 12 |
13 #include "base/atomic_ref_count.h" | 13 #include "base/atomic_ref_count.h" |
14 #include "base/base_export.h" | 14 #include "base/base_export.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/memory/ref_counted.h" | 16 #include "base/memory/ref_counted.h" |
17 #include "base/memory/scoped_ptr.h" | 17 #include "base/memory/scoped_ptr.h" |
18 #include "base/template_util.h" | 18 #include "base/template_util.h" |
19 | 19 |
20 template <typename T> | |
21 class ScopedVector; | |
22 | |
23 namespace base { | 20 namespace base { |
24 namespace internal { | 21 namespace internal { |
25 class CallbackBase; | 22 class CallbackBase; |
26 | 23 |
27 // BindStateBase is used to provide an opaque handle that the Callback | 24 // BindStateBase is used to provide an opaque handle that the Callback |
28 // class can use to represent a function object with bound arguments. It | 25 // class can use to represent a function object with bound arguments. It |
29 // behaves as an existential type that is used by a corresponding | 26 // behaves as an existential type that is used by a corresponding |
30 // DoInvoke function to perform the function execution. This allows | 27 // DoInvoke function to perform the function execution. This allows |
31 // us to shield the Callback class from the types of the bound argument via | 28 // us to shield the Callback class from the types of the bound argument via |
32 // "type erasure." | 29 // "type erasure." |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 | 222 |
226 template <typename T> | 223 template <typename T> |
227 typename enable_if<IsMoveOnlyType<T>::value, T>::type CallbackForward(T& t) { | 224 typename enable_if<IsMoveOnlyType<T>::value, T>::type CallbackForward(T& t) { |
228 return t.Pass(); | 225 return t.Pass(); |
229 } | 226 } |
230 | 227 |
231 } // namespace internal | 228 } // namespace internal |
232 } // namespace base | 229 } // namespace base |
233 | 230 |
234 #endif // BASE_CALLBACK_INTERNAL_H_ | 231 #endif // BASE_CALLBACK_INTERNAL_H_ |
OLD | NEW |