| 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/callback.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ref_counted.h" | 12 #include "base/memory/ref_counted.h" |
| 13 #include "base/time/time.h" | 13 #include "base/time/time.h" |
| 14 #include "platform/PlatformExport.h" | 14 #include "platform/PlatformExport.h" |
| 15 #include "platform/WebTaskRunner.h" | 15 #include "platform/WebTaskRunner.h" |
| 16 | 16 |
| 17 namespace blink { | 17 namespace blink { |
| 18 namespace scheduler { | 18 namespace scheduler { |
| 19 class TaskQueue; | 19 class TaskQueue; |
| 20 | 20 |
| 21 class PLATFORM_EXPORT WebTaskRunnerImpl : public WebTaskRunner { | 21 class PLATFORM_EXPORT WebTaskRunnerImpl : public WebTaskRunner { |
| 22 public: | 22 public: |
| 23 static RefPtr<WebTaskRunnerImpl> Create(scoped_refptr<TaskQueue> task_queue); | 23 static RefPtr<WebTaskRunnerImpl> Create(scoped_refptr<TaskQueue> task_queue); |
| 24 | 24 |
| 25 // WebTaskRunner implementation: | 25 // WebTaskRunner implementation: |
| 26 void PostDelayedTask(const WebTraceLocation&, | |
| 27 base::OnceClosure, | |
| 28 double delay_ms) override; | |
| 29 bool RunsTasksInCurrentSequence() override; | 26 bool RunsTasksInCurrentSequence() override; |
| 30 double VirtualTimeSeconds() const override; | 27 double VirtualTimeSeconds() const override; |
| 31 double MonotonicallyIncreasingVirtualTimeSeconds() const override; | 28 double MonotonicallyIncreasingVirtualTimeSeconds() const override; |
| 32 base::SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; | 29 base::SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; |
| 33 | 30 |
| 34 TaskQueue* GetTaskQueue() const { return task_queue_.get(); } | 31 TaskQueue* GetTaskQueue() const { return task_queue_.get(); } |
| 35 | 32 |
| 36 private: | 33 private: |
| 37 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); | 34 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); |
| 38 ~WebTaskRunnerImpl() override; | 35 ~WebTaskRunnerImpl() override; |
| 39 | 36 |
| 40 base::TimeTicks Now() const; | 37 base::TimeTicks Now() const; |
| 41 | 38 |
| 42 scoped_refptr<TaskQueue> task_queue_; | 39 scoped_refptr<TaskQueue> task_queue_; |
| 43 | 40 |
| 44 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 41 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
| 45 }; | 42 }; |
| 46 | 43 |
| 47 } // namespace scheduler | 44 } // namespace scheduler |
| 48 } // namespace blink | 45 } // namespace blink |
| 49 | 46 |
| 50 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ | 47 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ |
| OLD | NEW |