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 WebScheduler_h | 5 #ifndef WebScheduler_h |
6 #define WebScheduler_h | 6 #define WebScheduler_h |
7 | 7 |
8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
9 #include "public/platform/WebPassOwnPtr.h" | 9 #include "public/platform/WebPassOwnPtr.h" |
10 #include "public/platform/WebTaskRunner.h" | 10 #include "public/platform/WebTaskRunner.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 // make it run later than it normally would, but it won't make it | 53 // make it run later than it normally would, but it won't make it |
54 // run earlier than it normally would. | 54 // run earlier than it normally would. |
55 virtual void postNonNestableIdleTask(const WebTraceLocation&, WebThread::Idl
eTask*) = 0; | 55 virtual void postNonNestableIdleTask(const WebTraceLocation&, WebThread::Idl
eTask*) = 0; |
56 | 56 |
57 // Like postIdleTask but does not run the idle task until after some other | 57 // Like postIdleTask but does not run the idle task until after some other |
58 // task has run. This enables posting of a task which won't stop the Blink | 58 // task has run. This enables posting of a task which won't stop the Blink |
59 // main thread from sleeping, but will start running after it wakes up. | 59 // main thread from sleeping, but will start running after it wakes up. |
60 // Takes ownership of |IdleTask|. Can be called from any thread. | 60 // Takes ownership of |IdleTask|. Can be called from any thread. |
61 virtual void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::Idl
eTask*) = 0; | 61 virtual void postIdleTaskAfterWakeup(const WebTraceLocation&, WebThread::Idl
eTask*) = 0; |
62 | 62 |
| 63 // Schedule a timer task to be run on the the associated WebThread. Timer Ta
sks |
| 64 // tasks usually have the default priority, but may be delayed |
| 65 // when the user is interacting with the device. |
| 66 // |monotonicTime| is in the timebase of WTF::monotonicallyIncreasingTime(). |
| 67 // Takes ownership of |WebTaskRunner::Task|. Can be called from any thread. |
| 68 // TODO(alexclarke): Move timer throttling for background pages to the |
| 69 // chromium side and remove this. |
| 70 virtual void postTimerTaskAt(const WebTraceLocation&, WebTaskRunner::Task*,
double monotonicTime) = 0; |
| 71 |
63 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. | 72 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. |
64 virtual WebTaskRunner* loadingTaskRunner() = 0; | 73 virtual WebTaskRunner* loadingTaskRunner() = 0; |
65 | 74 |
66 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. | 75 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. |
67 virtual WebTaskRunner* timerTaskRunner() = 0; | 76 virtual WebTaskRunner* timerTaskRunner() = 0; |
68 | 77 |
69 // Creates a new WebViewScheduler for a given WebView. Must be called from | 78 // Creates a new WebViewScheduler for a given WebView. Must be called from |
70 // the associated WebThread. | 79 // the associated WebThread. |
71 virtual WebPassOwnPtr<WebViewScheduler> createWebViewScheduler(blink::WebVie
w*) = 0; | 80 virtual WebPassOwnPtr<WebViewScheduler> createWebViewScheduler(blink::WebVie
w*) = 0; |
72 | 81 |
(...skipping 21 matching lines...) Expand all Loading... |
94 | 103 |
95 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 104 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
96 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 105 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
97 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 106 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
98 #endif | 107 #endif |
99 }; | 108 }; |
100 | 109 |
101 } // namespace blink | 110 } // namespace blink |
102 | 111 |
103 #endif // WebScheduler_h | 112 #endif // WebScheduler_h |
OLD | NEW |