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 "public/platform/WebTraceLocation.h" | 9 #include "public/platform/WebTraceLocation.h" |
10 #include <memory> | 10 #include <memory> |
(...skipping 22 matching lines...) Expand all Loading... |
33 }; | 33 }; |
34 | 34 |
35 // Schedule a task to be run on the the associated WebThread. | 35 // Schedule a task to be run on the the associated WebThread. |
36 // Takes ownership of |Task|. Can be called from any thread. | 36 // Takes ownership of |Task|. Can be called from any thread. |
37 virtual void postTask(const WebTraceLocation&, Task*) = 0; | 37 virtual void postTask(const WebTraceLocation&, Task*) = 0; |
38 | 38 |
39 // Schedule a task to be run after |delayMs| on the the associated WebThread
. | 39 // Schedule a task to be run after |delayMs| on the the associated WebThread
. |
40 // Takes ownership of |Task|. Can be called from any thread. | 40 // Takes ownership of |Task|. Can be called from any thread. |
41 virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs)
= 0; | 41 virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs)
= 0; |
42 | 42 |
| 43 // Schedule a task to be run after |delayMs| on the the associated WebThread
. |
| 44 // Can be called from any thread. |
| 45 virtual void postDelayedTask(const WebTraceLocation&, const base::Closure&,
double delayMs) = 0; |
| 46 |
43 // Returns a clone of the WebTaskRunner. | 47 // Returns a clone of the WebTaskRunner. |
44 virtual std::unique_ptr<WebTaskRunner> clone() = 0; | 48 virtual std::unique_ptr<WebTaskRunner> clone() = 0; |
45 | 49 |
46 // Returns true if the current thread is a thread on which a task may be run
. | 50 // Returns true if the current thread is a thread on which a task may be run
. |
47 // Can be called from any thread. | 51 // Can be called from any thread. |
48 virtual bool runsTasksOnCurrentThread() = 0; | 52 virtual bool runsTasksOnCurrentThread() = 0; |
49 | 53 |
50 // --- | 54 // --- |
51 | 55 |
52 // Headless Chrome virtualises time for determinism and performance (fast fo
rwarding | 56 // Headless Chrome virtualises time for determinism and performance (fast fo
rwarding |
(...skipping 24 matching lines...) Expand all Loading... |
77 | 81 |
78 // For same-thread posting. Must be called from the associated WebThread. | 82 // For same-thread posting. Must be called from the associated WebThread. |
79 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); | 83 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); |
80 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>,
long long delayMs); | 84 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>,
long long delayMs); |
81 #endif | 85 #endif |
82 }; | 86 }; |
83 | 87 |
84 } // namespace blink | 88 } // namespace blink |
85 | 89 |
86 #endif // WebTaskRunner_h | 90 #endif // WebTaskRunner_h |
OLD | NEW |