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 #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 on the the associated WebThread. | |
| 44 // Can be called from any thread. | |
| 45 virtual void postTask(const WebTraceLocation&, const base::Closure&) = 0; | |
|
alex clarke (OOO till 29th)
2016/09/21 10:38:40
Getting rid of WebCallbackTask is a good idea, but
tzik
2016/09/21 14:32:08
Ah, right. Updated. We can use SingleThreadTaskRun
| |
| 46 | |
| 43 // Schedule a task to be run after |delayMs| on the the associated WebThread . | 47 // Schedule a task to be run after |delayMs| on the the associated WebThread . |
| 44 // Can be called from any thread. | 48 // Can be called from any thread. |
| 45 virtual void postDelayedTask(const WebTraceLocation&, const base::Closure&, double delayMs) = 0; | 49 virtual void postDelayedTask(const WebTraceLocation&, const base::Closure&, double delayMs) = 0; |
| 46 | 50 |
| 47 // Returns a clone of the WebTaskRunner. | 51 // Returns a clone of the WebTaskRunner. |
| 48 virtual std::unique_ptr<WebTaskRunner> clone() = 0; | 52 virtual std::unique_ptr<WebTaskRunner> clone() = 0; |
| 49 | 53 |
| 50 // Returns true if the current thread is a thread on which a task may be run . | 54 // Returns true if the current thread is a thread on which a task may be run . |
| 51 // Can be called from any thread. | 55 // Can be called from any thread. |
| 52 virtual bool runsTasksOnCurrentThread() = 0; | 56 virtual bool runsTasksOnCurrentThread() = 0; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 81 | 85 |
| 82 // For same-thread posting. Must be called from the associated WebThread. | 86 // For same-thread posting. Must be called from the associated WebThread. |
| 83 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); | 87 void postTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>); |
| 84 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>, long long delayMs); | 88 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<WTF::Closure>, long long delayMs); |
| 85 #endif | 89 #endif |
| 86 }; | 90 }; |
| 87 | 91 |
| 88 } // namespace blink | 92 } // namespace blink |
| 89 | 93 |
| 90 #endif // WebTaskRunner_h | 94 #endif // WebTaskRunner_h |
| OLD | NEW |