OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_IMPL_H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_IMPL_H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_IMPL_H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDULER
_IMPL_H_ |
7 | 7 |
8 #include "base/atomicops.h" | 8 #include "base/atomicops.h" |
9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // Test helpers. | 184 // Test helpers. |
185 SchedulerHelper* GetSchedulerHelperForTesting(); | 185 SchedulerHelper* GetSchedulerHelperForTesting(); |
186 TaskCostEstimator* GetLoadingTaskCostEstimatorForTesting(); | 186 TaskCostEstimator* GetLoadingTaskCostEstimatorForTesting(); |
187 TaskCostEstimator* GetTimerTaskCostEstimatorForTesting(); | 187 TaskCostEstimator* GetTimerTaskCostEstimatorForTesting(); |
188 IdleTimeEstimator* GetIdleTimeEstimatorForTesting(); | 188 IdleTimeEstimator* GetIdleTimeEstimatorForTesting(); |
189 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const; | 189 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const; |
190 void RunIdleTasksForTesting(const base::Closure& callback); | 190 void RunIdleTasksForTesting(const base::Closure& callback); |
191 void EndIdlePeriodForTesting(const base::Closure& callback, | 191 void EndIdlePeriodForTesting(const base::Closure& callback, |
192 base::TimeTicks time_remaining); | 192 base::TimeTicks time_remaining); |
193 bool PolicyNeedsUpdateForTesting(); | 193 bool PolicyNeedsUpdateForTesting(); |
| 194 WakeUpBudgetPool* GetWakeUpBudgetPoolForTesting(); |
194 | 195 |
195 base::TickClock* tick_clock() const; | 196 base::TickClock* tick_clock() const; |
196 | 197 |
197 RealTimeDomain* real_time_domain() const { | 198 RealTimeDomain* real_time_domain() const { |
198 return helper_.real_time_domain(); | 199 return helper_.real_time_domain(); |
199 } | 200 } |
200 | 201 |
201 AutoAdvancingVirtualTimeDomain* GetVirtualTimeDomain(); | 202 AutoAdvancingVirtualTimeDomain* GetVirtualTimeDomain(); |
202 | 203 |
203 TimeDomain* GetActiveTimeDomain(); | 204 TimeDomain* GetActiveTimeDomain(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 TaskQueue* task_queue, | 388 TaskQueue* task_queue, |
388 TaskQueue::QueueEnabledVoter* task_queue_enabled_voter, | 389 TaskQueue::QueueEnabledVoter* task_queue_enabled_voter, |
389 const TaskQueuePolicy& old_task_queue_policy, | 390 const TaskQueuePolicy& old_task_queue_policy, |
390 const TaskQueuePolicy& new_task_queue_policy) const; | 391 const TaskQueuePolicy& new_task_queue_policy) const; |
391 | 392 |
392 static const char* ExpensiveTaskPolicyToString( | 393 static const char* ExpensiveTaskPolicyToString( |
393 ExpensiveTaskPolicy expensive_task_policy); | 394 ExpensiveTaskPolicy expensive_task_policy); |
394 | 395 |
395 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); | 396 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); |
396 | 397 |
| 398 void AddQueueToWakeUpBudgetPool(TaskQueue* queue); |
| 399 |
397 SchedulerHelper helper_; | 400 SchedulerHelper helper_; |
398 IdleHelper idle_helper_; | 401 IdleHelper idle_helper_; |
399 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_; | 402 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_; |
400 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; | 403 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; |
401 RenderWidgetSignals render_widget_scheduler_signals_; | 404 RenderWidgetSignals render_widget_scheduler_signals_; |
402 | 405 |
403 const scoped_refptr<TaskQueue> control_task_runner_; | 406 const scoped_refptr<TaskQueue> control_task_runner_; |
404 const scoped_refptr<TaskQueue> compositor_task_runner_; | 407 const scoped_refptr<TaskQueue> compositor_task_runner_; |
405 std::unique_ptr<TaskQueue::QueueEnabledVoter> | 408 std::unique_ptr<TaskQueue::QueueEnabledVoter> |
406 compositor_task_runner_enabled_voter_; | 409 compositor_task_runner_enabled_voter_; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 bool have_seen_a_begin_main_frame; | 469 bool have_seen_a_begin_main_frame; |
467 bool have_reported_blocking_intervention_in_current_policy; | 470 bool have_reported_blocking_intervention_in_current_policy; |
468 bool have_reported_blocking_intervention_since_navigation; | 471 bool have_reported_blocking_intervention_since_navigation; |
469 bool has_visible_render_widget_with_touch_handler; | 472 bool has_visible_render_widget_with_touch_handler; |
470 bool begin_frame_not_expected_soon; | 473 bool begin_frame_not_expected_soon; |
471 bool in_idle_period_for_testing; | 474 bool in_idle_period_for_testing; |
472 bool use_virtual_time; | 475 bool use_virtual_time; |
473 bool is_audio_playing; | 476 bool is_audio_playing; |
474 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. | 477 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. |
475 RAILModeObserver* rail_mode_observer; // Not owned. | 478 RAILModeObserver* rail_mode_observer; // Not owned. |
| 479 WakeUpBudgetPool* wake_up_budget_pool; // Not owned. |
476 }; | 480 }; |
477 | 481 |
478 struct AnyThread { | 482 struct AnyThread { |
479 AnyThread(); | 483 AnyThread(); |
480 ~AnyThread(); | 484 ~AnyThread(); |
481 | 485 |
482 base::TimeTicks last_idle_period_end_time; | 486 base::TimeTicks last_idle_period_end_time; |
483 base::TimeTicks fling_compositor_escalation_deadline; | 487 base::TimeTicks fling_compositor_escalation_deadline; |
484 UserModel user_model; | 488 UserModel user_model; |
485 bool awaiting_touch_start_response; | 489 bool awaiting_touch_start_response; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
545 | 549 |
546 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 550 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
547 | 551 |
548 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 552 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
549 }; | 553 }; |
550 | 554 |
551 } // namespace scheduler | 555 } // namespace scheduler |
552 } // namespace blink | 556 } // namespace blink |
553 | 557 |
554 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ | 558 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ |
OLD | NEW |