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 | 9 |
10 #ifdef INSIDE_BLINK | 10 #ifdef INSIDE_BLINK |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; | 58 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; |
59 | 59 |
60 #ifdef INSIDE_BLINK | 60 #ifdef INSIDE_BLINK |
61 // Helpers for posting bound functions as tasks. | 61 // Helpers for posting bound functions as tasks. |
62 | 62 |
63 // For cross-thread posting. Can be called from any thread. | 63 // For cross-thread posting. Can be called from any thread. |
64 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); | 64 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); |
65 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo
sure>, long long delayMs); | 65 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClo
sure>, long long delayMs); |
66 | 66 |
67 // For same-thread posting. Must be called from the associated WebThread. | 67 // For same-thread posting. Must be called from the associated WebThread. |
68 void postTask(const WebTraceLocation&, std::unique_ptr<SameThreadClosure>); | 68 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); |
69 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<SameThreadClos
ure>, long long delayMs); | 69 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>,
long long delayMs); |
70 | 70 |
71 std::unique_ptr<WebTaskRunner> adoptClone() | 71 std::unique_ptr<WebTaskRunner> adoptClone() |
72 { | 72 { |
73 return wrapUnique(clone()); | 73 return wrapUnique(clone()); |
74 } | 74 } |
75 #endif | 75 #endif |
76 }; | 76 }; |
77 | 77 |
78 } // namespace blink | 78 } // namespace blink |
79 | 79 |
80 #endif // WebTaskRunner_h | 80 #endif // WebTaskRunner_h |
OLD | NEW |