| 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/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 // nagigation. This function does that. Must be called from the main thread. | 353 // nagigation. This function does that. Must be called from the main thread. |
| 354 void ResetForNavigationLocked(); | 354 void ResetForNavigationLocked(); |
| 355 | 355 |
| 356 // Estimates the maximum task length that won't cause a jank based on the | 356 // Estimates the maximum task length that won't cause a jank based on the |
| 357 // current system state. Must be called from the main thread. | 357 // current system state. Must be called from the main thread. |
| 358 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; | 358 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; |
| 359 | 359 |
| 360 // Report an intervention to all WebViews in this process. | 360 // Report an intervention to all WebViews in this process. |
| 361 void BroadcastIntervention(const std::string& message); | 361 void BroadcastIntervention(const std::string& message); |
| 362 | 362 |
| 363 void ApplyTaskQueuePolicy(TaskQueue* task_queue, | 363 void ApplyTaskQueuePolicy( |
| 364 const TaskQueuePolicy& old_task_queue_policy, | 364 TaskQueue* task_queue, |
| 365 const TaskQueuePolicy& new_task_queue_policy) const; | 365 TaskQueue::QueueEnabledVoter* task_queue_enabled_voter, |
| 366 const TaskQueuePolicy& old_task_queue_policy, |
| 367 const TaskQueuePolicy& new_task_queue_policy) const; |
| 366 | 368 |
| 367 static const char* ExpensiveTaskPolicyToString( | 369 static const char* ExpensiveTaskPolicyToString( |
| 368 ExpensiveTaskPolicy expensive_task_policy); | 370 ExpensiveTaskPolicy expensive_task_policy); |
| 369 | 371 |
| 370 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); | 372 bool ShouldDisableThrottlingBecauseOfAudio(base::TimeTicks now); |
| 371 | 373 |
| 372 SchedulerHelper helper_; | 374 SchedulerHelper helper_; |
| 373 IdleHelper idle_helper_; | 375 IdleHelper idle_helper_; |
| 374 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; | 376 std::unique_ptr<TaskQueueThrottler> task_queue_throttler_; |
| 375 RenderWidgetSignals render_widget_scheduler_signals_; | 377 RenderWidgetSignals render_widget_scheduler_signals_; |
| 376 | 378 |
| 377 const scoped_refptr<TaskQueue> control_task_runner_; | 379 const scoped_refptr<TaskQueue> control_task_runner_; |
| 378 const scoped_refptr<TaskQueue> compositor_task_runner_; | 380 const scoped_refptr<TaskQueue> compositor_task_runner_; |
| 379 std::set<scoped_refptr<TaskQueue>> loading_task_runners_; | 381 std::unique_ptr<TaskQueue::QueueEnabledVoter> |
| 380 std::set<scoped_refptr<TaskQueue>> timer_task_runners_; | 382 compositor_task_runner_enabled_voter_; |
| 383 |
| 384 using TaskQueueVoterMap = |
| 385 std::map<scoped_refptr<TaskQueue>, |
| 386 std::unique_ptr<TaskQueue::QueueEnabledVoter>>; |
| 387 |
| 388 TaskQueueVoterMap loading_task_runners_; |
| 389 TaskQueueVoterMap timer_task_runners_; |
| 381 std::set<scoped_refptr<TaskQueue>> unthrottled_task_runners_; | 390 std::set<scoped_refptr<TaskQueue>> unthrottled_task_runners_; |
| 382 scoped_refptr<TaskQueue> default_loading_task_runner_; | 391 scoped_refptr<TaskQueue> default_loading_task_runner_; |
| 383 scoped_refptr<TaskQueue> default_timer_task_runner_; | 392 scoped_refptr<TaskQueue> default_timer_task_runner_; |
| 384 | 393 |
| 385 // Note |virtual_time_domain_| is lazily created. | 394 // Note |virtual_time_domain_| is lazily created. |
| 386 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; | 395 std::unique_ptr<AutoAdvancingVirtualTimeDomain> virtual_time_domain_; |
| 387 | 396 |
| 388 base::Closure update_policy_closure_; | 397 base::Closure update_policy_closure_; |
| 389 DeadlineTaskRunner delayed_update_policy_runner_; | 398 DeadlineTaskRunner delayed_update_policy_runner_; |
| 390 CancelableClosureHolder end_renderer_hidden_idle_period_closure_; | 399 CancelableClosureHolder end_renderer_hidden_idle_period_closure_; |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 504 PollableThreadSafeFlag policy_may_need_update_; | 513 PollableThreadSafeFlag policy_may_need_update_; |
| 505 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 514 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 506 | 515 |
| 507 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 516 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 508 }; | 517 }; |
| 509 | 518 |
| 510 } // namespace scheduler | 519 } // namespace scheduler |
| 511 } // namespace blink | 520 } // namespace blink |
| 512 | 521 |
| 513 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ | 522 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ |
| OLD | NEW |