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&, | 26 void PostDelayedTask(const WebTraceLocation&, |
27 base::OnceClosure, | 27 base::OnceClosure, |
28 double delay_ms) override; | 28 double delay_ms) override; |
29 bool RunsTasksOnCurrentThread() override; | 29 bool RunsTasksInCurrentSequence() override; |
30 double VirtualTimeSeconds() const override; | 30 double VirtualTimeSeconds() const override; |
31 double MonotonicallyIncreasingVirtualTimeSeconds() const override; | 31 double MonotonicallyIncreasingVirtualTimeSeconds() const override; |
32 base::SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; | 32 base::SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; |
33 | 33 |
34 TaskQueue* GetTaskQueue() const { return task_queue_.get(); } | 34 TaskQueue* GetTaskQueue() const { return task_queue_.get(); } |
35 | 35 |
36 private: | 36 private: |
37 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); | 37 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); |
38 ~WebTaskRunnerImpl() override; | 38 ~WebTaskRunnerImpl() override; |
39 | 39 |
40 base::TimeTicks Now() const; | 40 base::TimeTicks Now() const; |
41 | 41 |
42 scoped_refptr<TaskQueue> task_queue_; | 42 scoped_refptr<TaskQueue> task_queue_; |
43 | 43 |
44 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 44 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
45 }; | 45 }; |
46 | 46 |
47 } // namespace scheduler | 47 } // namespace scheduler |
48 } // namespace blink | 48 } // namespace blink |
49 | 49 |
50 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ | 50 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_CHILD_WEB_TASK_RUNNER_IM
PL_H_ |
OLD | NEW |