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; | |
35 bool runsTasksOnCurrentThread() override; | 32 bool runsTasksOnCurrentThread() override; |
36 double virtualTimeSeconds() const override; | 33 double virtualTimeSeconds() const override; |
37 double monotonicallyIncreasingVirtualTimeSeconds() const override; | 34 double monotonicallyIncreasingVirtualTimeSeconds() const override; |
38 std::unique_ptr<WebTaskRunner> clone() override; | 35 std::unique_ptr<WebTaskRunner> clone() override; |
39 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; | 36 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; |
40 | 37 |
41 // WebTaskRunner::Task should be wrapped by base::Passed() when | 38 // WebTaskRunner::Task should be wrapped by base::Passed() when |
42 // used with base::Bind(). See https://crbug.com/551356. | 39 // used with base::Bind(). See https://crbug.com/551356. |
43 // runTask() is a helper to call WebTaskRunner::Task::run from | 40 // runTask() is a helper to call WebTaskRunner::Task::run from |
44 // std::unique_ptr<WebTaskRunner::Task>. | 41 // std::unique_ptr<WebTaskRunner::Task>. |
45 // runTask() is placed here because std::unique_ptr<> cannot be used from | 42 // runTask() is placed here because std::unique_ptr<> cannot be used from |
46 // Blink. | 43 // Blink. |
47 static void runTask(std::unique_ptr<WebTaskRunner::Task>); | 44 static void runTask(std::unique_ptr<WebTaskRunner::Task>); |
48 | 45 |
49 private: | 46 private: |
50 base::TimeTicks Now() const; | 47 base::TimeTicks Now() const; |
51 | 48 |
52 scoped_refptr<TaskQueue> task_queue_; | 49 scoped_refptr<TaskQueue> task_queue_; |
53 | 50 |
54 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 51 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
55 }; | 52 }; |
56 | 53 |
57 } // namespace scheduler | 54 } // namespace scheduler |
58 } // namespace blink | 55 } // namespace blink |
59 | 56 |
60 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ | 57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ |
OLD | NEW |