OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 WebTaskRunner_h | 5 #ifndef WebTaskRunner_h |
6 #define WebTaskRunner_h | 6 #define WebTaskRunner_h |
7 | 7 |
8 #include "WebCommon.h" | 8 #include "WebCommon.h" |
9 #include "base/callback_forward.h" | 9 #include "base/callback_forward.h" |
10 #include "public/platform/WebTraceLocation.h" | 10 #include "public/platform/WebTraceLocation.h" |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 | 83 |
84 // Schedule a task to be run after |delayMs| on the the associated WebThread. | 84 // Schedule a task to be run after |delayMs| on the the associated WebThread. |
85 // Can be called from any thread. | 85 // Can be called from any thread. |
86 virtual void postDelayedTask(const WebTraceLocation&, | 86 virtual void postDelayedTask(const WebTraceLocation&, |
87 const base::Closure&, | 87 const base::Closure&, |
88 double delayMs) = 0; | 88 double delayMs) = 0; |
89 | 89 |
90 // Returns a clone of the WebTaskRunner. | 90 // Returns a clone of the WebTaskRunner. |
91 virtual std::unique_ptr<WebTaskRunner> clone() = 0; | 91 virtual std::unique_ptr<WebTaskRunner> clone() = 0; |
92 | 92 |
| 93 // Returns true if this is a clone of another WebTaskRunner. |
| 94 virtual bool isCloneOf(WebTaskRunner*) = 0; |
| 95 |
93 // Returns true if the current thread is a thread on which a task may be run. | 96 // Returns true if the current thread is a thread on which a task may be run. |
94 // Can be called from any thread. | 97 // Can be called from any thread. |
95 virtual bool runsTasksOnCurrentThread() = 0; | 98 virtual bool runsTasksOnCurrentThread() = 0; |
96 | 99 |
97 // --- | 100 // --- |
98 | 101 |
99 // Headless Chrome virtualises time for determinism and performance (fast | 102 // Headless Chrome virtualises time for determinism and performance (fast |
100 // forwarding of timers). To make this work some parts of blink (e.g. Timers) | 103 // forwarding of timers). To make this work some parts of blink (e.g. Timers) |
101 // need to use virtual time, however by default new code should use the normal | 104 // need to use virtual time, however by default new code should use the normal |
102 // non-virtual time APIs. | 105 // non-virtual time APIs. |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 RefPtr<TaskHandle> postDelayedCancellableTask(const WebTraceLocation&, | 142 RefPtr<TaskHandle> postDelayedCancellableTask(const WebTraceLocation&, |
140 std::unique_ptr<WTF::Closure>, | 143 std::unique_ptr<WTF::Closure>, |
141 long long delayMs) | 144 long long delayMs) |
142 WARN_UNUSED_RETURN; | 145 WARN_UNUSED_RETURN; |
143 #endif | 146 #endif |
144 }; | 147 }; |
145 | 148 |
146 } // namespace blink | 149 } // namespace blink |
147 | 150 |
148 #endif // WebTaskRunner_h | 151 #endif // WebTaskRunner_h |
OLD | NEW |