| 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 |
| 49 // Called to notify about the start of an extended period where no frames | 57 // 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. | 58 // need to be drawn. Must be called from the main thread. |
| 51 virtual void BeginFrameNotExpectedSoon() = 0; | 59 virtual void BeginFrameNotExpectedSoon() = 0; |
| 52 | 60 |
| 53 // Called to notify about the start of a new frame. Must be called from the | 61 // Called to notify about the start of a new frame. Must be called from the |
| 54 // main thread. | 62 // main thread. |
| 55 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; | 63 virtual void WillBeginFrame(const cc::BeginFrameArgs& args) = 0; |
| 56 | 64 |
| 57 // Called to notify that a previously begun frame was committed. Must be | 65 // Called to notify that a previously begun frame was committed. Must be |
| 58 // called from the main thread. | 66 // 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; | 138 virtual void SetTimerQueueSuspensionWhenBackgroundedEnabled(bool enabled) = 0; |
| 131 | 139 |
| 132 protected: | 140 protected: |
| 133 RendererScheduler(); | 141 RendererScheduler(); |
| 134 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 142 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 135 }; | 143 }; |
| 136 | 144 |
| 137 } // namespace scheduler | 145 } // namespace scheduler |
| 138 | 146 |
| 139 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ | 147 #endif // COMPONENTS_SCHEDULER_RENDERER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |