| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 base::TimeTicks now, | 325 base::TimeTicks now, |
| 325 base::TimeDelta* expected_use_case_duration) const; | 326 base::TimeDelta* expected_use_case_duration) const; |
| 326 | 327 |
| 327 // An input event of some sort happened, the policy may need updating. | 328 // An input event of some sort happened, the policy may need updating. |
| 328 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, | 329 void UpdateForInputEventOnCompositorThread(WebInputEvent::Type type, |
| 329 InputEventState input_event_state); | 330 InputEventState input_event_state); |
| 330 | 331 |
| 331 // Helpers for safely suspending/resuming the timer queue after a | 332 // Helpers for safely suspending/resuming the timer queue after a |
| 332 // background/foreground signal. | 333 // background/foreground signal. |
| 333 void SuspendTimerQueueWhenBackgrounded(); | 334 void SuspendTimerQueueWhenBackgrounded(); |
| 334 void ResumeTimerQueueWhenForegrounded(); | 335 void ResumeTimerQueueWhenForegroundedOrResumed(); |
| 335 | 336 |
| 336 // The task cost estimators and the UserModel need to be reset upon page | 337 // The task cost estimators and the UserModel need to be reset upon page |
| 337 // nagigation. This function does that. Must be called from the main thread. | 338 // nagigation. This function does that. Must be called from the main thread. |
| 338 void ResetForNavigationLocked(); | 339 void ResetForNavigationLocked(); |
| 339 | 340 |
| 340 // Estimates the maximum task length that won't cause a jank based on the | 341 // Estimates the maximum task length that won't cause a jank based on the |
| 341 // current system state. Must be called from the main thread. | 342 // current system state. Must be called from the main thread. |
| 342 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; | 343 base::TimeDelta EstimateLongestJankFreeTaskDuration() const; |
| 343 | 344 |
| 344 // Report an intervention to all WebViews in this process. | 345 // Report an intervention to all WebViews in this process. |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 PollableThreadSafeFlag policy_may_need_update_; | 489 PollableThreadSafeFlag policy_may_need_update_; |
| 489 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; | 490 base::WeakPtrFactory<RendererSchedulerImpl> weak_factory_; |
| 490 | 491 |
| 491 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); | 492 DISALLOW_COPY_AND_ASSIGN(RendererSchedulerImpl); |
| 492 }; | 493 }; |
| 493 | 494 |
| 494 } // namespace scheduler | 495 } // namespace scheduler |
| 495 } // namespace blink | 496 } // namespace blink |
| 496 | 497 |
| 497 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ | 498 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_RENDERER_RENDERER_SCHEDU
LER_IMPL_H_ |
| OLD | NEW |