Index: base/callback_forward.h |
diff --git a/base/callback_forward.h b/base/callback_forward.h |
index 8b9b89cdc231bcf1020111e91bcbda14fd4e678c..ff0e3afefc26dfb412566bc3b7aba595cdaf90bc 100644 |
--- a/base/callback_forward.h |
+++ b/base/callback_forward.h |
@@ -15,16 +15,36 @@ enum class CopyMode { |
MoveOnly, Copyable, |
}; |
+enum class RepeatMode { |
+ Once, |
+ Repeating, |
+}; |
+ |
} // namespace internal |
template <typename Signature, |
- internal::CopyMode copy_mode = internal::CopyMode::Copyable> |
+ internal::CopyMode copy_mode = internal::CopyMode::Copyable, |
+ internal::RepeatMode repeat_mode = internal::RepeatMode::Repeating> |
class Callback; |
// Syntactic sugar to make Callback<void()> easier to declare since it |
// will be used in a lot of APIs with delayed execution. |
using Closure = Callback<void()>; |
+namespace internal { |
+ |
+template <typename Signature> |
+using RepeatingCallback = Callback<Signature, |
+ internal::CopyMode::Copyable, |
+ internal::RepeatMode::Repeating>; |
+template <typename Signature> |
+using OnceCallback = Callback<Signature, |
+ internal::CopyMode::MoveOnly, |
+ internal::RepeatMode::Once>; |
+using RepeatingClosure = RepeatingCallback<void()>; |
+using OnceClosure = OnceCallback<void()>; |
+ |
+} // namespace internal |
} // namespace base |
#endif // BASE_CALLBACK_FORWARD_H_ |