| 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 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 // Test helpers. | 188 // Test helpers. |
| 189 SchedulerHelper* GetSchedulerHelperForTesting(); | 189 SchedulerHelper* GetSchedulerHelperForTesting(); |
| 190 TaskCostEstimator* GetLoadingTaskCostEstimatorForTesting(); | 190 TaskCostEstimator* GetLoadingTaskCostEstimatorForTesting(); |
| 191 TaskCostEstimator* GetTimerTaskCostEstimatorForTesting(); | 191 TaskCostEstimator* GetTimerTaskCostEstimatorForTesting(); |
| 192 IdleTimeEstimator* GetIdleTimeEstimatorForTesting(); | 192 IdleTimeEstimator* GetIdleTimeEstimatorForTesting(); |
| 193 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const; | 193 base::TimeTicks CurrentIdleTaskDeadlineForTesting() const; |
| 194 void RunIdleTasksForTesting(const base::Closure& callback); | 194 void RunIdleTasksForTesting(const base::Closure& callback); |
| 195 void EndIdlePeriodForTesting(const base::Closure& callback, | 195 void EndIdlePeriodForTesting(const base::Closure& callback, |
| 196 base::TimeTicks time_remaining); | 196 base::TimeTicks time_remaining); |
| 197 bool PolicyNeedsUpdateForTesting(); | 197 bool PolicyNeedsUpdateForTesting(); |
| 198 WakeUpBudgetPool* GetWakeUpBudgetPoolForTesting(); |
| 198 | 199 |
| 199 base::TickClock* tick_clock() const; | 200 base::TickClock* tick_clock() const; |
| 200 | 201 |
| 201 RealTimeDomain* real_time_domain() const { | 202 RealTimeDomain* real_time_domain() const { |
| 202 return helper_.real_time_domain(); | 203 return helper_.real_time_domain(); |
| 203 } | 204 } |
| 204 | 205 |
| 205 AutoAdvancingVirtualTimeDomain* GetVirtualTimeDomain(); | 206 AutoAdvancingVirtualTimeDomain* GetVirtualTimeDomain(); |
| 206 | 207 |
| 207 TimeDomain* GetActiveTimeDomain(); | 208 TimeDomain* GetActiveTimeDomain(); |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 TaskQueue* task_queue, | 392 TaskQueue* task_queue, |
| 392 TaskQueue::QueueEnabledVoter* task_queue_enabled_voter, | 393 TaskQueue::QueueEnabledVoter* task_queue_enabled_voter, |
| 393 const TaskQueuePolicy& old_task_queue_policy, | 394 const TaskQueuePolicy& old_task_queue_policy, |
| 394 const TaskQueuePolicy& new_task_queue_policy) const; | 395 const TaskQueuePolicy& new_task_queue_policy) const; |
| 395 | 396 |
| 396 static const char* ExpensiveTaskPolicyToString( | 397 static const char* ExpensiveTaskPolicyToString( |
| 397 ExpensiveTaskPolicy expensive_task_policy); | 398 ExpensiveTaskPolicy expensive_task_policy); |
| 398 | 399 |
| 399 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); | 400 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); |
| 400 | 401 |
| 402 void AddQueueToWakeUpBudgetPool(TaskQueue* queue); |
| 403 |
| 401 SchedulerHelper helper_; | 404 SchedulerHelper helper_; |
| 402 IdleHelper idle_helper_; | 405 IdleHelper idle_helper_; |
| 403 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_; | 406 IdleCanceledDelayedTaskSweeper idle_canceled_delayed_task_sweeper_; |
| 404 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; | 407 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; |
| 405 RenderWidgetSignals render_widget_scheduler_signals_; | 408 RenderWidgetSignals render_widget_scheduler_signals_; |
| 406 | 409 |
| 407 const scoped_refptr<TaskQueue> control_task_queue_; | 410 const scoped_refptr<TaskQueue> control_task_queue_; |
| 408 const scoped_refptr<TaskQueue> compositor_task_queue_; | 411 const scoped_refptr<TaskQueue> compositor_task_queue_; |
| 409 scoped_refptr<TaskQueue> virtual_time_control_task_queue_; | 412 scoped_refptr<TaskQueue> virtual_time_control_task_queue_; |
| 410 std::unique_ptr<TaskQueue::QueueEnabledVoter> | 413 std::unique_ptr<TaskQueue::QueueEnabledVoter> |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 471 bool have_seen_a_begin_main_frame; | 474 bool have_seen_a_begin_main_frame; |
| 472 bool have_reported_blocking_intervention_in_current_policy; | 475 bool have_reported_blocking_intervention_in_current_policy; |
| 473 bool have_reported_blocking_intervention_since_navigation; | 476 bool have_reported_blocking_intervention_since_navigation; |
| 474 bool has_visible_render_widget_with_touch_handler; | 477 bool has_visible_render_widget_with_touch_handler; |
| 475 bool begin_frame_not_expected_soon; | 478 bool begin_frame_not_expected_soon; |
| 476 bool in_idle_period_for_testing; | 479 bool in_idle_period_for_testing; |
| 477 bool use_virtual_time; | 480 bool use_virtual_time; |
| 478 bool is_audio_playing; | 481 bool is_audio_playing; |
| 479 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. | 482 std::set<WebViewSchedulerImpl*> web_view_schedulers; // Not owned. |
| 480 RAILModeObserver* rail_mode_observer; // Not owned. | 483 RAILModeObserver* rail_mode_observer; // Not owned. |
| 484 WakeUpBudgetPool* wake_up_budget_pool; // Not owned. |
| 481 }; | 485 }; |
| 482 | 486 |
| 483 struct AnyThread { | 487 struct AnyThread { |
| 484 AnyThread(); | 488 AnyThread(); |
| 485 ~AnyThread(); | 489 ~AnyThread(); |
| 486 | 490 |
| 487 base::TimeTicks last_idle_period_end_time; | 491 base::TimeTicks last_idle_period_end_time; |
| 488 base::TimeTicks fling_compositor_escalation_deadline; | 492 base::TimeTicks fling_compositor_escalation_deadline; |
| 489 UserModel user_model; | 493 UserModel user_model; |
| 490 bool awaiting_touch_start_response; | 494 bool awaiting_touch_start_response; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 554 |
| 551 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 555 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 552 | 556 |
| 553 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 557 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 554 }; | 558 }; |
| 555 | 559 |
| 556 } // namespace scheduler | 560 } // namespace scheduler |
| 557 } // namespace blink | 561 } // namespace blink |
| 558 | 562 |
| 559 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ | 563 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ |
| OLD | NEW |