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