| 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 CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ | 5 #ifndef CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ | 6 #define CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" | 8 #include "content/renderer/scheduler/single_thread_idle_task_runner.h" |
| 9 #include "content/renderer/scheduler/task_queue_manager.h" | 9 #include "content/renderer/scheduler/task_queue_manager.h" |
| 10 #include "third_party/WebKit/public/web/WebInputEvent.h" | 10 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 | 29 |
| 30 // Returns the idle task runner. Tasks posted to this runner may be reordered | 30 // Returns the idle task runner. Tasks posted to this runner may be reordered |
| 31 // relative to other task types and may be starved for an arbitrarily long | 31 // relative to other task types and may be starved for an arbitrarily long |
| 32 // time if no idle time is available. | 32 // time if no idle time is available. |
| 33 virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0; | 33 virtual scoped_refptr<SingleThreadIdleTaskRunner> IdleTaskRunner() = 0; |
| 34 | 34 |
| 35 // Returns the loading task runner. This queue is intended for tasks related | 35 // Returns the loading task runner. This queue is intended for tasks related |
| 36 // to resource dispatch, foreground HTML parsing, etc... | 36 // to resource dispatch, foreground HTML parsing, etc... |
| 37 virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; | 37 virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; |
| 38 | 38 |
| 39 // Returns the timer task runner. This queue is intended for DOM Timers. |
| 40 virtual scoped_refptr<base::SingleThreadTaskRunner> TimerTaskRunner() = 0; |
| 41 |
| 39 // Called to notify about the start of an extended period where no frames | 42 // Called to notify about the start of an extended period where no frames |
| 40 // need to be drawn. Must be called from the main thread. | 43 // need to be drawn. Must be called from the main thread. |
| 41 virtual void BeginFrameNotExpectedSoon() = 0; | 44 virtual void BeginFrameNotExpectedSoon() = 0; |
| 42 | 45 |
| 43 // Called to notify about the start of a new frame. Must be called from the | 46 // Called to notify about the start of a new frame. Must be called from the |
| 44 // main thread. | 47 // main thread. |
| 45 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; | 48 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; |
| 46 | 49 |
| 47 // Called to notify that a previously begun frame was committed. Must be | 50 // Called to notify that a previously begun frame was committed. Must be |
| 48 // called from the main thread. | 51 // called from the main thread. |
| (...skipping 27 matching lines...) Expand all Loading... |
| 76 virtual void AddTaskObserver( | 79 virtual void AddTaskObserver( |
| 77 base::MessageLoop::TaskObserver* task_observer) = 0; | 80 base::MessageLoop::TaskObserver* task_observer) = 0; |
| 78 virtual void RemoveTaskObserver( | 81 virtual void RemoveTaskObserver( |
| 79 base::MessageLoop::TaskObserver* task_observer) = 0; | 82 base::MessageLoop::TaskObserver* task_observer) = 0; |
| 80 | 83 |
| 81 // Shuts down the scheduler by dropping any remaining pending work in the work | 84 // Shuts down the scheduler by dropping any remaining pending work in the work |
| 82 // queues. After this call any work posted to the task runners will be | 85 // queues. After this call any work posted to the task runners will be |
| 83 // silently dropped. | 86 // silently dropped. |
| 84 virtual void Shutdown() = 0; | 87 virtual void Shutdown() = 0; |
| 85 | 88 |
| 89 // Suspends the timer queue and increments the timer queue suspension count. |
| 90 // May only be called from the main thread. |
| 91 virtual void SuspendTimerQueue() = 0; |
| 92 |
| 93 // Decrements the timer queue suspension count and re-enables the timer queue |
| 94 // if the suspension count is zero and the scheduler is not in TOUCH_START |
| 95 // policy. |
| 96 virtual void ResumeTimerQueue() = 0; |
| 97 |
| 86 protected: | 98 protected: |
| 87 RendererScheduler(); | 99 RendererScheduler(); |
| 88 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 100 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 89 }; | 101 }; |
| 90 | 102 |
| 91 } // namespace content | 103 } // namespace content |
| 92 | 104 |
| 93 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ | 105 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |