| 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 COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 5 #ifndef COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| 6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 6 #define COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| 7 | 7 |
| 8 #include "base/message_loop/message_loop.h" | 8 #include "base/message_loop/message_loop.h" |
| 9 #include "components/scheduler/child/child_scheduler.h" | 9 #include "components/scheduler/child/child_scheduler.h" |
| 10 #include "components/scheduler/child/single_thread_idle_task_runner.h" | 10 #include "components/scheduler/child/single_thread_idle_task_runner.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 USE_CASE_COUNT, | 37 USE_CASE_COUNT, |
| 38 FIRST_USE_CASE = NONE, | 38 FIRST_USE_CASE = NONE, |
| 39 }; | 39 }; |
| 40 static const char* UseCaseToString(UseCase use_case); | 40 static const char* UseCaseToString(UseCase use_case); |
| 41 | 41 |
| 42 // Returns the loading task runner. This queue is intended for tasks related | 42 // Returns the loading task runner. This queue is intended for tasks related |
| 43 // to resource dispatch, foreground HTML parsing, etc... | 43 // to resource dispatch, foreground HTML parsing, etc... |
| 44 virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; | 44 virtual scoped_refptr<base::SingleThreadTaskRunner> LoadingTaskRunner() = 0; |
| 45 | 45 |
| 46 // Returns the timer task runner. This queue is intended for DOM Timers. | 46 // Returns the timer task runner. This queue is intended for DOM Timers. |
| 47 // TODO(alexclarke): Get rid of this default timer queue. |
| 47 virtual scoped_refptr<TaskQueue> TimerTaskRunner() = 0; | 48 virtual scoped_refptr<TaskQueue> TimerTaskRunner() = 0; |
| 48 | 49 |
| 50 // Returns a new loading task runner. This queue is intended for tasks related |
| 51 // to resource dispatch, foreground HTML parsing, etc... |
| 52 virtual scoped_refptr<TaskQueue> NewLoadingTaskRunner(const char* name) = 0; |
| 53 |
| 54 // Returns a new timer task runner. This queue is intended for DOM Timers. |
| 55 virtual scoped_refptr<TaskQueue> NewTimerTaskRunner(const char* name) = 0; |
| 56 |
| 57 // Unregisters a task queue previously created by |
| 58 // |NewLoadingTaskRunner()| or |NewTimerTaskRunner()|. |
| 59 virtual void UnregisterTaskRunner(scoped_refptr<TaskQueue>& task_queue) = 0; |
| 60 |
| 49 // Called to notify about the start of an extended period where no frames | 61 // Called to notify about the start of an extended period where no frames |
| 50 // need to be drawn. Must be called from the main thread. | 62 // need to be drawn. Must be called from the main thread. |
| 51 virtual void BeginFrameNotExpectedSoon() = 0; | 63 virtual void BeginFrameNotExpectedSoon() = 0; |
| 52 | 64 |
| 53 // Called to notify about the start of a new frame. Must be called from the | 65 // Called to notify about the start of a new frame. Must be called from the |
| 54 // main thread. | 66 // main thread. |
| 55 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; | 67 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; |
| 56 | 68 |
| 57 // Called to notify that a previously begun frame was committed. Must be | 69 // Called to notify that a previously begun frame was committed. Must be |
| 58 // called from the main thread. | 70 // called from the main thread. |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; | 142 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; |
| 131 | 143 |
| 132 protected: | 144 protected: |
| 133 RendererScheduler(); | 145 RendererScheduler(); |
| 134 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 146 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 135 }; | 147 }; |
| 136 | 148 |
| 137 } // namespace scheduler | 149 } // namespace scheduler |
| 138 | 150 |
| 139 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 151 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |