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

Unified Diff: components/scheduler/renderer/idle_time_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/idle_time_estimator.cc
diff --git a/components/scheduler/renderer/idle_time_estimator.cc b/components/scheduler/renderer/idle_time_estimator.cc
index 52e72da2eba36a009b958afba2ea72cc3f80893c..30c91561b5d741be7418d28d982c69715da81f42 100644
--- a/components/scheduler/renderer/idle_time_estimator.cc
+++ b/components/scheduler/renderer/idle_time_estimator.cc
@@ -10,11 +10,12 @@ namespace scheduler {
IdleTimeEstimator::IdleTimeEstimator(
const scoped_refptr<TaskQueue>& compositor_task_runner,
+ base::TickClock* time_source,
int sample_count,
double estimation_percentile)
: compositor_task_runner_(compositor_task_runner),
per_frame_compositor_task_runtime_(sample_count),
- time_source_(new base::DefaultTickClock),
+ time_source_(time_source),
estimation_percentile_(estimation_percentile),
nesting_level_(0),
did_commit_(false) {
@@ -48,11 +49,6 @@ void IdleTimeEstimator::Clear() {
did_commit_ = false;
}
-void IdleTimeEstimator::SetTimeSourceForTesting(
- scoped_ptr<base::TickClock> time_source) {
- time_source_ = time_source.Pass();
-}
-
void IdleTimeEstimator::WillProcessTask(const base::PendingTask& pending_task) {
nesting_level_++;
if (nesting_level_ == 1)
« no previous file with comments | « components/scheduler/renderer/idle_time_estimator.h ('k') | components/scheduler/renderer/idle_time_estimator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698