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 THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_
H_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_
H_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_
H_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IMPL_
H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); | 22 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); |
23 | 23 |
24 ~WebTaskRunnerImpl() override; | 24 ~WebTaskRunnerImpl() override; |
25 | 25 |
26 // WebTaskRunner implementation: | 26 // WebTaskRunner implementation: |
27 void postTask(const WebTraceLocation& web_location, | 27 void postTask(const WebTraceLocation& web_location, |
28 WebTaskRunner::Task* task) override; | 28 WebTaskRunner::Task* task) override; |
29 void postDelayedTask(const WebTraceLocation& web_location, | 29 void postDelayedTask(const WebTraceLocation& web_location, |
30 WebTaskRunner::Task* task, | 30 WebTaskRunner::Task* task, |
31 double delayMs) override; | 31 double delayMs) override; |
| 32 void postDelayedTask(const WebTraceLocation&, |
| 33 const base::Closure&, |
| 34 double delayMs) override; |
32 bool runsTasksOnCurrentThread() override; | 35 bool runsTasksOnCurrentThread() override; |
33 double virtualTimeSeconds() const override; | 36 double virtualTimeSeconds() const override; |
34 double monotonicallyIncreasingVirtualTimeSeconds() const override; | 37 double monotonicallyIncreasingVirtualTimeSeconds() const override; |
35 std::unique_ptr<WebTaskRunner> clone() override; | 38 std::unique_ptr<WebTaskRunner> clone() override; |
36 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; | 39 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; |
37 | 40 |
38 // WebTaskRunner::Task should be wrapped by base::Passed() when | 41 // WebTaskRunner::Task should be wrapped by base::Passed() when |
39 // used with base::Bind(). See https://crbug.com/551356. | 42 // used with base::Bind(). See https://crbug.com/551356. |
40 // runTask() is a helper to call WebTaskRunner::Task::run from | 43 // runTask() is a helper to call WebTaskRunner::Task::run from |
41 // std::unique_ptr<WebTaskRunner::Task>. | 44 // std::unique_ptr<WebTaskRunner::Task>. |
42 // runTask() is placed here because std::unique_ptr<> cannot be used from | 45 // runTask() is placed here because std::unique_ptr<> cannot be used from |
43 // Blink. | 46 // Blink. |
44 static void runTask(std::unique_ptr<WebTaskRunner::Task>); | 47 static void runTask(std::unique_ptr<WebTaskRunner::Task>); |
45 | 48 |
46 private: | 49 private: |
47 base::TimeTicks Now() const; | 50 base::TimeTicks Now() const; |
48 | 51 |
49 scoped_refptr<TaskQueue> task_queue_; | 52 scoped_refptr<TaskQueue> task_queue_; |
50 | 53 |
51 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 54 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
52 }; | 55 }; |
53 | 56 |
54 } // namespace scheduler | 57 } // namespace scheduler |
55 } // namespace blink | 58 } // namespace blink |
56 | 59 |
57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ | 60 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ |
OLD | NEW |