[task] Create AlignWakeUps feature
This feature aligns wake ups at 8ms (finchable) boundary in
ThreadControllerWithMessagePumpImpl when allowed by the next pending
wake up.
Doing this in ThreadControllerWithMessagePumpImpl leaves mock time
untouched such that tasks run at the expected time in tests.
Bug: 1153139
Change-Id: Ic03964ac173b5f0775e9d07a67a0115d3acb7bd7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3396250
Reviewed-by: Francois Pierre Doray <[email protected]>
Commit-Queue: Etienne Pierre-Doray <[email protected]>
Cr-Commit-Position: refs/heads/main@{#967822}
diff --git a/base/task/task_features.h b/base/task/task_features.h
index 00086d6..9f43038 100644
--- a/base/task/task_features.h
+++ b/base/task/task_features.h
@@ -76,6 +76,10 @@
extern const BASE_EXPORT Feature kAddTaskLeewayFeature;
extern const BASE_EXPORT base::FeatureParam<TimeDelta> kTaskLeewayParam;
+// Under this feature, wake ups are aligned at a 4ms boundary when allowed per
+// DelayPolicy.
+extern const BASE_EXPORT base::Feature kAlignWakeUps;
+
} // namespace base
#endif // BASE_TASK_TASK_FEATURES_H_