| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 virtual double virtualTimeSeconds() const = 0; | 50 virtual double virtualTimeSeconds() const = 0; |
| 51 | 51 |
| 52 // Returns a microsecond resolution platform dependant time source. | 52 // Returns a microsecond resolution platform dependant time source. |
| 53 // This may represent either the real time, or a virtual time depending on | 53 // This may represent either the real time, or a virtual time depending on |
| 54 // whether or not the WebTaskRunner is associated with a virtual time domain
or a | 54 // whether or not the WebTaskRunner is associated with a virtual time domain
or a |
| 55 // real time domain. | 55 // real time domain. |
| 56 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; | 56 virtual double monotonicallyIncreasingVirtualTimeSeconds() const = 0; |
| 57 | 57 |
| 58 #ifdef INSIDE_BLINK | 58 #ifdef INSIDE_BLINK |
| 59 // Helpers for posting bound functions as tasks. | 59 // Helpers for posting bound functions as tasks. |
| 60 typedef Function<void()> ClosureTask; | |
| 61 | 60 |
| 62 void postTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>); | 61 // For cross-thread posting. Can be called from any thread. |
| 63 // TODO(alexclarke): Remove this when possible. | 62 void postTask(const WebTraceLocation&, PassOwnPtr<CrossThreadClosure>); |
| 64 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, long
long delayMs); | 63 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<CrossThreadClosure>
, long long delayMs); |
| 65 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, doubl
e delayMs); | 64 |
| 65 // For same-thread posting. Must be called from the associated WebThread. |
| 66 void postTask(const WebTraceLocation&, PassOwnPtr<SameThreadClosure>); |
| 67 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<SameThreadClosure>,
long long delayMs); |
| 66 | 68 |
| 67 PassOwnPtr<WebTaskRunner> adoptClone() | 69 PassOwnPtr<WebTaskRunner> adoptClone() |
| 68 { | 70 { |
| 69 return adoptPtr(clone()); | 71 return adoptPtr(clone()); |
| 70 } | 72 } |
| 71 #endif | 73 #endif |
| 72 }; | 74 }; |
| 73 | 75 |
| 74 } // namespace blink | 76 } // namespace blink |
| 75 | 77 |
| 76 #endif // WebTaskRunner_h | 78 #endif // WebTaskRunner_h |
| OLD | NEW |