| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, | 64 // that this is a stricter condition than |IsHighPriorityWorkAnticipated|, |
| 65 // restricted to the case where real work is pending. | 65 // restricted to the case where real work is pending. |
| 66 // Must be called from the main thread. | 66 // Must be called from the main thread. |
| 67 virtual bool ShouldYieldForHighPriorityWork() = 0; | 67 virtual bool ShouldYieldForHighPriorityWork() = 0; |
| 68 | 68 |
| 69 // Shuts down the scheduler by dropping any remaining pending work in the work | 69 // Shuts down the scheduler by dropping any remaining pending work in the work |
| 70 // queues. After this call any work posted to the task runners will be | 70 // queues. After this call any work posted to the task runners will be |
| 71 // silently dropped. | 71 // silently dropped. |
| 72 virtual void Shutdown() = 0; | 72 virtual void Shutdown() = 0; |
| 73 | 73 |
| 74 // These functions can only be called on the main thread. |
| 75 virtual void AddTaskObserver( |
| 76 base::MessageLoop::TaskObserver* task_observer) = 0; |
| 77 virtual void RemoveTaskObserver( |
| 78 base::MessageLoop::TaskObserver* task_observer) = 0; |
| 79 |
| 74 protected: | 80 protected: |
| 75 RendererScheduler(); | 81 RendererScheduler(); |
| 76 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 82 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 77 }; | 83 }; |
| 78 | 84 |
| 79 } // namespace content | 85 } // namespace content |
| 80 | 86 |
| 81 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ | 87 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |