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 | |
72 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. | 63 // Returns a WebTaskRunner for loading tasks. Can be called from any thread. |
73 virtual WebTaskRunner* loadingTaskRunner() = 0; | 64 virtual WebTaskRunner* loadingTaskRunner() = 0; |
74 | 65 |
75 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. | 66 // Returns a WebTaskRunner for timer tasks. Can be called from any thread. |
76 virtual WebTaskRunner* timerTaskRunner() = 0; | 67 virtual WebTaskRunner* timerTaskRunner() = 0; |
77 | 68 |
78 // Creates a new WebViewScheduler for a given WebView. Must be called from | 69 // Creates a new WebViewScheduler for a given WebView. Must be called from |
79 // the associated WebThread. | 70 // the associated WebThread. |
80 virtual WebPassOwnPtr<WebViewScheduler> createWebViewScheduler(blink::WebVie
w*) = 0; | 71 virtual WebPassOwnPtr<WebViewScheduler> createWebViewScheduler(blink::WebVie
w*) = 0; |
81 | 72 |
(...skipping 21 matching lines...) Expand all Loading... |
103 | 94 |
104 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 95 void postIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
105 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 96 void postNonNestableIdleTask(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
106 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); | 97 void postIdleTaskAfterWakeup(const WebTraceLocation&, PassOwnPtr<IdleTask>); |
107 #endif | 98 #endif |
108 }; | 99 }; |
109 | 100 |
110 } // namespace blink | 101 } // namespace blink |
111 | 102 |
112 #endif // WebScheduler_h | 103 #endif // WebScheduler_h |
OLD | NEW |