| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_FORWARD_H_ | 5 #ifndef BASE_CALLBACK_FORWARD_H_ |
| 6 #define BASE_CALLBACK_FORWARD_H_ | 6 #define BASE_CALLBACK_FORWARD_H_ |
| 7 | 7 |
| 8 namespace base { | 8 namespace base { |
| 9 namespace internal { | 9 namespace internal { |
| 10 | 10 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 template <typename Signature, | 26 template <typename Signature, |
| 27 internal::CopyMode copy_mode = internal::CopyMode::Copyable, | 27 internal::CopyMode copy_mode = internal::CopyMode::Copyable, |
| 28 internal::RepeatMode repeat_mode = internal::RepeatMode::Repeating> | 28 internal::RepeatMode repeat_mode = internal::RepeatMode::Repeating> |
| 29 class Callback; | 29 class Callback; |
| 30 | 30 |
| 31 // Syntactic sugar to make Callback<void()> easier to declare since it | 31 // Syntactic sugar to make Callback<void()> easier to declare since it |
| 32 // will be used in a lot of APIs with delayed execution. | 32 // will be used in a lot of APIs with delayed execution. |
| 33 using Closure = Callback<void()>; | 33 using Closure = Callback<void()>; |
| 34 | 34 |
| 35 namespace internal { | |
| 36 | |
| 37 template <typename Signature> | 35 template <typename Signature> |
| 38 using OnceCallback = Callback<Signature, | 36 using OnceCallback = Callback<Signature, |
| 39 internal::CopyMode::MoveOnly, | 37 internal::CopyMode::MoveOnly, |
| 40 internal::RepeatMode::Once>; | 38 internal::RepeatMode::Once>; |
| 41 template <typename Signature> | 39 template <typename Signature> |
| 42 using RepeatingCallback = Callback<Signature, | 40 using RepeatingCallback = Callback<Signature, |
| 43 internal::CopyMode::Copyable, | 41 internal::CopyMode::Copyable, |
| 44 internal::RepeatMode::Repeating>; | 42 internal::RepeatMode::Repeating>; |
| 45 using OnceClosure = OnceCallback<void()>; | 43 using OnceClosure = OnceCallback<void()>; |
| 46 using RepeatingClosure = RepeatingCallback<void()>; | 44 using RepeatingClosure = RepeatingCallback<void()>; |
| 47 | 45 |
| 48 } // namespace internal | |
| 49 } // namespace base | 46 } // namespace base |
| 50 | 47 |
| 51 #endif // BASE_CALLBACK_FORWARD_H_ | 48 #endif // BASE_CALLBACK_FORWARD_H_ |
| OLD | NEW |