| 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 void DidCommitFrameToCompositor() override; | 95 void DidCommitFrameToCompositor() override; |
| 96 void DidHandleInputEventOnCompositorThread( | 96 void DidHandleInputEventOnCompositorThread( |
| 97 const WebInputEvent& web_input_event, | 97 const WebInputEvent& web_input_event, |
| 98 InputEventState event_state) override; | 98 InputEventState event_state) override; |
| 99 void DidHandleInputEventOnMainThread( | 99 void DidHandleInputEventOnMainThread( |
| 100 const WebInputEvent& web_input_event) override; | 100 const WebInputEvent& web_input_event) override; |
| 101 void DidAnimateForInputOnCompositorThread() override; | 101 void DidAnimateForInputOnCompositorThread() override; |
| 102 void OnRendererBackgrounded() override; | 102 void OnRendererBackgrounded() override; |
| 103 void OnRendererForegrounded() override; | 103 void OnRendererForegrounded() override; |
| 104 void SuspendRenderer() override; | 104 void SuspendRenderer() override; |
| 105 void ResumeRenderer() override; |
| 105 void AddPendingNavigation(WebScheduler::NavigatingFrameType type) override; | 106 void AddPendingNavigation(WebScheduler::NavigatingFrameType type) override; |
| 106 void RemovePendingNavigation(WebScheduler::NavigatingFrameType type) override; | 107 void RemovePendingNavigation(WebScheduler::NavigatingFrameType type) override; |
| 107 void OnNavigationStarted() override; | 108 void OnNavigationStarted() override; |
| 108 bool IsHighPriorityWorkAnticipated() override; | 109 bool IsHighPriorityWorkAnticipated() override; |
| 109 bool ShouldYieldForHighPriorityWork() override; | 110 bool ShouldYieldForHighPriorityWork() override; |
| 110 bool CanExceedIdleDeadlineIfRequired() const override; | 111 bool CanExceedIdleDeadlineIfRequired() const override; |
| 111 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; | 112 void AddTaskObserver(base::MessageLoop::TaskObserver* task_observer) override; |
| 112 void RemoveTaskObserver( | 113 void RemoveTaskObserver( |
| 113 base::MessageLoop::TaskObserver* task_observer) override; | 114 base::MessageLoop::TaskObserver* task_observer) override; |
| 114 void Shutdown() override; | 115 void Shutdown() override; |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 base::TimeTicks now, | 317 base::TimeTicks now, |
| 317 base::TimeDelta* expected_use_case_duration) const; | 318 base::TimeDelta* expected_use_case_duration) const; |
| 318 | 319 |
| 319 // An input event of some sort happened, the policy may need updating. | 320 // An input event of some sort happened, the policy may need updating. |
| 320 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, | 321 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, |
| 321 InputEventState input_event_state); | 322 InputEventState input_event_state); |
| 322 | 323 |
| 323 // Helpers for safely suspending/resuming the timer queue after a | 324 // Helpers for safely suspending/resuming the timer queue after a |
| 324 // background/foreground signal. | 325 // background/foreground signal. |
| 325 void SuspendTimerQueueWhenBackgrounded(); | 326 void SuspendTimerQueueWhenBackgrounded(); |
| 326 void ResumeTimerQueueWhenForegrounded(); | 327 void ResumeTimerQueueWhenForegroundedOrResumed(); |
| 327 | 328 |
| 328 // The task cost estimators and the UserModel need to be reset upon page | 329 // The task cost estimators and the UserModel need to be reset upon page |
| 329 // nagigation. This function does that. Must be called from the main thread. | 330 // nagigation. This function does that. Must be called from the main thread. |
| 330 void ResetForNavigationLocked(); | 331 void ResetForNavigationLocked(); |
| 331 | 332 |
| 332 // Estimates the maximum task length that won't cause a jank based on the | 333 // Estimates the maximum task length that won't cause a jank based on the |
| 333 // current system state. Must be called from the main thread. | 334 // current system state. Must be called from the main thread. |
| 334 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; | 335 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; |
| 335 | 336 |
| 336 // Report an intervention to all WebViews in this process. | 337 // Report an intervention to all WebViews in this process. |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 476 PollableThreadSafeFlag policy_may_need_update_; | 477 PollableThreadSafeFlag policy_may_need_update_; |
| 477 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 478 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 478 | 479 |
| 479 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 480 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 480 }; | 481 }; |
| 481 | 482 |
| 482 } // namespace scheduler | 483 } // namespace scheduler |
| 483 } // namespace blink | 484 } // namespace blink |
| 484 | 485 |
| 485 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ | 486 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ |
| OLD | NEW |