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

Unified Diff: components/scheduler/renderer/renderer_scheduler_impl.h

Issue 1411133003: A better idle time estimator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2526
Patch Set: 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/renderer_scheduler_impl.h
diff --git a/components/scheduler/renderer/renderer_scheduler_impl.h b/components/scheduler/renderer/renderer_scheduler_impl.h
index dbe1c003cd671a0d892564032a765833d50019a0..11061670619693b604724444ae09d1b417359405 100644
--- a/components/scheduler/renderer/renderer_scheduler_impl.h
+++ b/components/scheduler/renderer/renderer_scheduler_impl.h
@@ -11,6 +11,7 @@
#include "components/scheduler/child/idle_helper.h"
#include "components/scheduler/child/scheduler_helper.h"
#include "components/scheduler/renderer/deadline_task_runner.h"
+#include "components/scheduler/renderer/idle_time_estimator.h"
#include "components/scheduler/renderer/renderer_scheduler.h"
#include "components/scheduler/renderer/task_cost_estimator.h"
#include "components/scheduler/renderer/user_model.h"
@@ -75,6 +76,7 @@ class SCHEDULER_EXPORT RendererSchedulerImpl
SchedulerHelper* GetSchedulerHelperForTesting();
TaskCostEstimator* GetLoadingTaskCostEstimatorForTesting();
TaskCostEstimator* GetTimerTaskCostEstimatorForTesting();
+ IdleTimeEstimator* GetIdleTimeEstimatorForTesting();
base::TimeTicks CurrentIdleTaskDeadlineForTesting() const;
private:
@@ -142,6 +144,10 @@ class SCHEDULER_EXPORT RendererSchedulerImpl
// other tasks during the initial page load.
static const int kRailsInitialLoadingPrioritizationMillis = 1000;
+ // The amount of time in milliseconds we have to respond to user input as
+ // defined by RAILS.
+ static const int kRailsResponseTimeMillis = 50;
+
// For the purposes of deciding whether or not it's safe to turn timers and
// loading tasks on only in idle periods, we regard the system as being as
// being "idle period" starved if there hasn't been an idle period in the last
@@ -229,17 +235,19 @@ class SCHEDULER_EXPORT RendererSchedulerImpl
// (the accessors) for the following data members.
struct MainThreadOnly {
- MainThreadOnly();
+ explicit MainThreadOnly(
+ const scoped_refptr<TaskQueue>& compositor_task_runner);
~MainThreadOnly();
TaskCostEstimator loading_task_cost_estimator;
TaskCostEstimator timer_task_cost_estimator;
- cc::RollingTimeDeltaHistory short_idle_period_duration;
+ IdleTimeEstimator idle_time_estimator;
UseCase current_use_case;
Policy current_policy;
base::TimeTicks current_policy_expiration_time;
base::TimeTicks estimated_next_frame_begin;
- base::TimeDelta expected_short_idle_period_duration;
+ base::TimeDelta compositor_frame_interval;
+ base::TimeDelta expected_idle_duration;
int timer_queue_suspend_count; // TIMER_TASK_QUEUE suspended if non-zero.
int navigation_task_expected_count;
bool renderer_hidden;

Powered by Google App Engine
This is Rietveld 408576698