callback_forward.h 792 B

12345678910111213141516171819202122232425262728
  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
  3. // found in the LICENSE file.
  4. #ifndef BASE_CALLBACK_FORWARD_H_
  5. #define BASE_CALLBACK_FORWARD_H_
  6. namespace base {
  7. template <typename Signature>
  8. class OnceCallback;
  9. template <typename Signature>
  10. class RepeatingCallback;
  11. template <typename Signature>
  12. using Callback = RepeatingCallback<Signature>;
  13. // Syntactic sugar to make OnceClosure<void()> and RepeatingClosure<void()>
  14. // easier to declare since they will be used in a lot of APIs with delayed
  15. // execution.
  16. using OnceClosure = OnceCallback<void()>;
  17. using RepeatingClosure = RepeatingCallback<void()>;
  18. using Closure = Callback<void()>;
  19. } // namespace base
  20. #endif // BASE_CALLBACK_FORWARD_H_