| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/scheduler/renderer/task_cost_estimator.h" | 5 #include "components/scheduler/renderer/task_cost_estimator.h" |
| 6 | 6 |
| 7 namespace scheduler { | 7 namespace scheduler { |
| 8 | 8 |
| 9 TaskCostEstimator::TaskCostEstimator(int sample_count, | 9 TaskCostEstimator::TaskCostEstimator(int sample_count, |
| 10 double estimation_percentile) | 10 double estimation_percentile) |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 // TODO(skyostil): Should we do this less often? | 28 // TODO(skyostil): Should we do this less often? |
| 29 expected_task_duration_ = | 29 expected_task_duration_ = |
| 30 rolling_time_delta_history_.Percentile(estimation_percentile_); | 30 rolling_time_delta_history_.Percentile(estimation_percentile_); |
| 31 } | 31 } |
| 32 } | 32 } |
| 33 | 33 |
| 34 base::TimeTicks TaskCostEstimator::Now() { | 34 base::TimeTicks TaskCostEstimator::Now() { |
| 35 return base::TimeTicks::Now(); | 35 return base::TimeTicks::Now(); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void TaskCostEstimator::Clear() { | |
| 39 rolling_time_delta_history_.Clear(); | |
| 40 expected_task_duration_ = base::TimeDelta(); | |
| 41 } | |
| 42 | |
| 43 } // namespace scheduler | 38 } // namespace scheduler |
| OLD | NEW |