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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // real time domain. | 59 // real time domain. |
60 virtual double virtualTimeSeconds() const = 0; | 60 virtual double virtualTimeSeconds() const = 0; |
61 | 61 |
62 // Returns a microsecond resolution platform dependant time source. | 62 // Returns a microsecond resolution platform dependant time source. |
63 // This may represent either the real time, or a virtual time depending on | 63 // This may represent either the real time, or a virtual time depending on |
64 // whether or not the WebTaskRunner is associated with a virtual time domain
or a | 64 // whether or not the WebTaskRunner is associated with a virtual time domain
or a |
65 // real time domain. | 65 // real time domain. |
66 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; | 66 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; |
67 | 67 |
68 // Returns the underlying task runner object. | 68 // Returns the underlying task runner object. |
69 virtual SingleThreadTaskRunner* taskRunner() = 0; | 69 virtual SingleThreadTaskRunner* toSingleThreadTaskRunner() = 0; |
70 | 70 |
71 #ifdef INSIDE_BLINK | 71 #ifdef INSIDE_BLINK |
72 // Helpers for posting bound functions as tasks. | 72 // Helpers for posting bound functions as tasks. |
73 | 73 |
74 // For cross-thread posting. Can be called from any thread. | 74 // For cross-thread posting. Can be called from any thread. |
75 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); | 75 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); |
76 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo
sure>, long long delayMs); | 76 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo
sure>, long long delayMs); |
77 | 77 |
78 // For same-thread posting. Must be called from the associated WebThread. | 78 // For same-thread posting. Must be called from the associated WebThread. |
79 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); | 79 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); |
80 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); |
81 #endif | 81 #endif |
82 }; | 82 }; |
83 | 83 |
84 } // namespace blink | 84 } // namespace blink |
85 | 85 |
86 #endif // WebTaskRunner_h | 86 #endif // WebTaskRunner_h |
OLD | NEW |