| 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/callback.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 12 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 13 #include "platform/WebTaskRunner.h" | 14 #include "platform/WebTaskRunner.h" |
| 14 #include "public/platform/WebCommon.h" | 15 #include "public/platform/WebCommon.h" |
| 15 | 16 |
| 16 namespace blink { | 17 namespace blink { |
| 17 namespace scheduler { | 18 namespace scheduler { |
| 18 class TaskQueue; | 19 class TaskQueue; |
| 19 | 20 |
| 20 class BLINK_PLATFORM_EXPORT WebTaskRunnerImpl : public WebTaskRunner { | 21 class BLINK_PLATFORM_EXPORT WebTaskRunnerImpl : public WebTaskRunner { |
| 21 public: | 22 public: |
| 22 static RefPtr<WebTaskRunnerImpl> create(scoped_refptr<TaskQueue> task_queue); | 23 static RefPtr<WebTaskRunnerImpl> create(scoped_refptr<TaskQueue> task_queue); |
| 23 | 24 |
| 24 // WebTaskRunner implementation: | 25 // WebTaskRunner implementation: |
| 25 void postDelayedTask(const WebTraceLocation&, | 26 void postDelayedTask(const WebTraceLocation&, |
| 26 const base::Closure&, | 27 base::Closure, |
| 27 double delayMs) override; | 28 double delayMs) override; |
| 28 bool runsTasksOnCurrentThread() override; | 29 bool runsTasksOnCurrentThread() override; |
| 29 double virtualTimeSeconds() const override; | 30 double virtualTimeSeconds() const override; |
| 30 double monotonicallyIncreasingVirtualTimeSeconds() const override; | 31 double monotonicallyIncreasingVirtualTimeSeconds() const override; |
| 31 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; | 32 base::SingleThreadTaskRunner* toSingleThreadTaskRunner() override; |
| 32 | 33 |
| 33 private: | 34 private: |
| 34 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); | 35 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); |
| 35 ~WebTaskRunnerImpl() override; | 36 ~WebTaskRunnerImpl() override; |
| 36 | 37 |
| 37 base::TimeTicks Now() const; | 38 base::TimeTicks Now() const; |
| 38 | 39 |
| 39 scoped_refptr<TaskQueue> task_queue_; | 40 scoped_refptr<TaskQueue> task_queue_; |
| 40 | 41 |
| 41 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 42 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
| 42 }; | 43 }; |
| 43 | 44 |
| 44 } // namespace scheduler | 45 } // namespace scheduler |
| 45 } // namespace blink | 46 } // namespace blink |
| 46 | 47 |
| 47 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ | 48 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ |
| OLD | NEW |