Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 | 32 |
| 33 // Schedule a task to be run after |delayMs| on the the associated WebThread . | 33 // Schedule a task to be run after |delayMs| on the the associated WebThread . |
| 34 // Takes ownership of |Task|. Can be called from any thread. | 34 // Takes ownership of |Task|. Can be called from any thread. |
| 35 // TODO(alexclarke): Remove this when possible. | 35 // TODO(alexclarke): Remove this when possible. |
| 36 virtual void postDelayedTask(const WebTraceLocation&, Task*, long long delay Ms) {} | 36 virtual void postDelayedTask(const WebTraceLocation&, Task*, long long delay Ms) {} |
| 37 | 37 |
| 38 // Schedule a task to be run after |delayMs| on the the associated WebThread . | 38 // Schedule a task to be run after |delayMs| on the the associated WebThread . |
| 39 // Takes ownership of |Task|. Can be called from any thread. | 39 // Takes ownership of |Task|. Can be called from any thread. |
| 40 virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) {} | 40 virtual void postDelayedTask(const WebTraceLocation&, Task*, double delayMs) {} |
| 41 | 41 |
| 42 // Returns a clone of the WebTaskRunner. | |
| 43 virtual WebTaskRunner* clone() { return nullptr; } | |
|
Sami
2015/09/29 11:22:47
nit: I think these can be pure virtual now that we
alex clarke (OOO till 29th)
2015/09/29 16:10:36
Done.
| |
| 44 | |
| 42 #ifdef INSIDE_BLINK | 45 #ifdef INSIDE_BLINK |
| 43 // Helpers for posting bound functions as tasks. | 46 // Helpers for posting bound functions as tasks. |
| 44 typedef Function<void()> ClosureTask; | 47 typedef Function<void()> ClosureTask; |
| 45 | 48 |
| 46 void postTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>); | 49 void postTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>); |
| 47 // TODO(alexclarke): Remove this when possible. | 50 // TODO(alexclarke): Remove this when possible. |
| 48 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, long long delayMs); | 51 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, long long delayMs); |
| 49 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, doubl e delayMs); | 52 void postDelayedTask(const WebTraceLocation&, PassOwnPtr<ClosureTask>, doubl e delayMs); |
| 50 #endif | 53 #endif |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 } // namespace blink | 56 } // namespace blink |
| 54 | 57 |
| 55 #endif // WebTaskRunner_h | 58 #endif // WebTaskRunner_h |
| OLD | NEW |