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 |
11 #include "wtf/Functional.h" | 11 #include "wtf/Functional.h" |
| 12 #include "wtf/PtrUtil.h" |
| 13 #include <memory> |
12 #endif | 14 #endif |
13 | 15 |
14 namespace blink { | 16 namespace blink { |
15 | 17 |
16 class WebTraceLocation; | 18 class WebTraceLocation; |
17 | 19 |
18 // The blink representation of a chromium SingleThreadTaskRunner. | 20 // The blink representation of a chromium SingleThreadTaskRunner. |
19 class BLINK_PLATFORM_EXPORT WebTaskRunner { | 21 class BLINK_PLATFORM_EXPORT WebTaskRunner { |
20 public: | 22 public: |
21 virtual ~WebTaskRunner() {} | 23 virtual ~WebTaskRunner() {} |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 // Helpers for posting bound functions as tasks. | 61 // Helpers for posting bound functions as tasks. |
60 | 62 |
61 // For cross-thread posting. Can be called from any thread. | 63 // For cross-thread posting. Can be called from any thread. |
62 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); | 64 void postTask(const WebTraceLocation&, std::unique_ptr<CrossThreadClosure>); |
63 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); |
64 | 66 |
65 // For same-thread posting. Must be called from the associated WebThread. | 67 // For same-thread posting. Must be called from the associated WebThread. |
66 void postTask(const WebTraceLocation&, std::unique_ptr<SameThreadClosure>); | 68 void postTask(const WebTraceLocation&, std::unique_ptr<SameThreadClosure>); |
67 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<SameThreadClos
ure>, long long delayMs); | 69 void postDelayedTask(const WebTraceLocation&, std::unique_ptr<SameThreadClos
ure>, long long delayMs); |
68 | 70 |
69 PassOwnPtr<WebTaskRunner> adoptClone() | 71 std::unique_ptr<WebTaskRunner> adoptClone() |
70 { | 72 { |
71 return adoptPtr(clone()); | 73 return wrapUnique(clone()); |
72 } | 74 } |
73 #endif | 75 #endif |
74 }; | 76 }; |
75 | 77 |
76 } // namespace blink | 78 } // namespace blink |
77 | 79 |
78 #endif // WebTaskRunner_h | 80 #endif // WebTaskRunner_h |
OLD | NEW |