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