Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(386)

Unified Diff: components/scheduler/renderer/task_cost_estimator.cc

Issue 1424053002: Adds a flag to support "Virtual Time" to the blink scheduler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/scheduler/renderer/task_cost_estimator.cc
diff --git a/components/scheduler/renderer/task_cost_estimator.cc b/components/scheduler/renderer/task_cost_estimator.cc
index 910760dff42ab6a764499ff2e4e430667bbbb81d..ce8dee9087546b7054025c9a5129cc11eb47bbca 100644
--- a/components/scheduler/renderer/task_cost_estimator.cc
+++ b/components/scheduler/renderer/task_cost_estimator.cc
@@ -8,10 +8,11 @@
namespace scheduler {
-TaskCostEstimator::TaskCostEstimator(int sample_count,
+TaskCostEstimator::TaskCostEstimator(base::TickClock* time_source,
+ int sample_count,
double estimation_percentile)
: rolling_time_delta_history_(sample_count),
- time_source_(new base::DefaultTickClock),
+ time_source_(time_source),
outstanding_task_count_(0),
estimation_percentile_(estimation_percentile) {}
@@ -39,9 +40,4 @@ void TaskCostEstimator::Clear() {
expected_task_duration_ = base::TimeDelta();
}
-void TaskCostEstimator::SetTimeSourceForTesting(
- scoped_ptr<base::TickClock> time_source) {
- time_source_ = time_source.Pass();
-}
-
} // namespace scheduler
« no previous file with comments | « components/scheduler/renderer/task_cost_estimator.h ('k') | components/scheduler/renderer/task_cost_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698