| 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 42 | 42 |
| 43 // Tells the scheduler that the system received an input event. Called by the | 43 // Tells the scheduler that the system received an input event. Called by the |
| 44 // compositor (impl) thread. | 44 // compositor (impl) thread. |
| 45 virtual void DidReceiveInputEventOnCompositorThread( | 45 virtual void DidReceiveInputEventOnCompositorThread( |
| 46 blink::WebInputEvent::Type type) = 0; | 46 blink::WebInputEvent::Type type) = 0; |
| 47 | 47 |
| 48 // Tells the scheduler that the system is displaying an input animation (e.g. | 48 // Tells the scheduler that the system is displaying an input animation (e.g. |
| 49 // a fling). Called by the compositor (impl) thread. | 49 // a fling). Called by the compositor (impl) thread. |
| 50 virtual void DidAnimateForInputOnCompositorThread() = 0; | 50 virtual void DidAnimateForInputOnCompositorThread() = 0; |
| 51 | 51 |
| 52 // Returns true if the scheduler has reason to believe that high priority work |
| 53 // may soon arrive on the main thread, e.g., if gesture events were observed |
| 54 // recently. |
| 55 // Must be called from the main thread. |
| 56 virtual bool ShouldAnticipateHighPriorityWork() = 0; |
| 57 |
| 52 // Returns true if there is high priority work pending on the main thread | 58 // Returns true if there is high priority work pending on the main thread |
| 53 // and the caller should yield to let the scheduler service that work. | 59 // and the caller should yield to let the scheduler service that work. Note |
| 60 // that this is a stricter condition than |ShouldAnticipateHighPriorityWork|, |
| 61 // restricted to the case where real work is pending. |
| 54 // Must be called from the main thread. | 62 // Must be called from the main thread. |
| 55 virtual bool ShouldYieldForHighPriorityWork() = 0; | 63 virtual bool ShouldYieldForHighPriorityWork() = 0; |
| 56 | 64 |
| 57 // Shuts down the scheduler by dropping any remaining pending work in the work | 65 // Shuts down the scheduler by dropping any remaining pending work in the work |
| 58 // queues. After this call any work posted to the task runners will be | 66 // queues. After this call any work posted to the task runners will be |
| 59 // silently dropped. | 67 // silently dropped. |
| 60 virtual void Shutdown() = 0; | 68 virtual void Shutdown() = 0; |
| 61 | 69 |
| 62 protected: | 70 protected: |
| 63 RendererScheduler(); | 71 RendererScheduler(); |
| 64 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); | 72 DISALLOW_COPY_AND_ASSIGN(RendererScheduler); |
| 65 }; | 73 }; |
| 66 | 74 |
| 67 } // namespace content | 75 } // namespace content |
| 68 | 76 |
| 69 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ | 77 #endif // CONTENT_RENDERER_SCHEDULER_RENDERER_SCHEDULER_H_ |
| OLD | NEW |