delay_policy.h 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. // Copyright (c) 2021 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_TASK_DELAY_POLICY_H_
  5. #define BASE_TASK_DELAY_POLICY_H_
  6. namespace base {
  7. namespace subtle {
  8. // Policies affecting how a delayed task is scheduled when a TimeTicks is
  9. // specified.
  10. enum class DelayPolicy {
  11. // A delayed task with kFlexibleNoSooner may not run any sooner than the
  12. // specified time, but might run slightly after. This is the behavior implied
  13. // by PostDelayedTask.
  14. kFlexibleNoSooner,
  15. // A delayed task with kFlexiblePreferEarly means the task should attempt to
  16. // run near the deadline and preferably a little bit before than after if the
  17. // scheduler applies slack.
  18. kFlexiblePreferEarly,
  19. // A delayed task with kPrecise means it may not run any sooner than the
  20. // specified time and preferably as close as possible to the specified time,
  21. // which may affect scheduling policies if the scheduler usually applies
  22. // slack.
  23. kPrecise,
  24. };
  25. } // namespace subtle
  26. } // namespace base
  27. #endif // BASE_TASK_SEQUENCED_TASK_RUNNER_H_