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 24 matching lines...) Expand all Loading... |
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
. | 43 // Schedule a task to be run after |delayMs| on the the associated WebThread
. |
44 // Can be called from any thread. | 44 // Can be called from any thread. |
45 virtual void postDelayedTask(const WebTraceLocation&, const base::Closure&,
double delayMs) = 0; | 45 virtual void postDelayedTask(const WebTraceLocation&, base::OnceClosure, dou
ble delayMs) = 0; |
46 | 46 |
47 // Returns a clone of the WebTaskRunner. | 47 // Returns a clone of the WebTaskRunner. |
48 virtual std::unique_ptr<WebTaskRunner> clone() = 0; | 48 virtual std::unique_ptr<WebTaskRunner> clone() = 0; |
49 | 49 |
50 // 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
. |
51 // Can be called from any thread. | 51 // Can be called from any thread. |
52 virtual bool runsTasksOnCurrentThread() = 0; | 52 virtual bool runsTasksOnCurrentThread() = 0; |
53 | 53 |
54 // --- | 54 // --- |
55 | 55 |
(...skipping 25 matching lines...) Expand all Loading... |
81 | 81 |
82 // For same-thread posting. Must be called from the associated WebThread. | 82 // For same-thread posting. Must be called from the associated WebThread. |
83 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); | 83 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); |
84 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); |
85 #endif | 85 #endif |
86 }; | 86 }; |
87 | 87 |
88 } // namespace blink | 88 } // namespace blink |
89 | 89 |
90 #endif // WebTaskRunner_h | 90 #endif // WebTaskRunner_h |
OLD | NEW |