1 // Copyright 2021 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef BASE_TASK_DELAY_POLICY_H_ 6 #define BASE_TASK_DELAY_POLICY_H_ 7 8 namespace base { 9 namespace subtle { 10 11 // Policies affecting how a delayed task is scheduled when a TimeTicks is 12 // specified. 13 enum class DelayPolicy { 14 // A delayed task with kFlexibleNoSooner may not run any sooner than the 15 // specified time, but might run slightly after. This is the behavior implied 16 // by PostDelayedTask. 17 kFlexibleNoSooner, 18 // A delayed task with kFlexiblePreferEarly means the task should attempt to 19 // run near the deadline and preferably a little bit before than after if the 20 // scheduler applies slack. 21 kFlexiblePreferEarly, 22 // A delayed task with kPrecise means it may not run any sooner than the 23 // specified time and preferably as close as possible to the specified time, 24 // which may affect scheduling policies if the scheduler usually applies 25 // slack. 26 kPrecise, 27 }; 28 29 } // namespace subtle 30 } // namespace base 31 32 #endif // BASE_TASK_SEQUENCED_TASK_RUNNER_H_ 33