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/WebTaskRunner.h" | 14 #include "platform/WebTaskRunner.h" |
15 #include "public/platform/WebCommon.h" | 15 #include "public/platform/WebCommon.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 BLINK_PLATFORM_EXPORT WebTaskRunnerImpl : public WebTaskRunner { | 21 class BLINK_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::Closure, | 27 base::OnceClosure, |
28 double delayMs) override; | 28 double delayMs) override; |
29 bool runsTasksOnCurrentThread() override; | 29 bool runsTasksOnCurrentThread() 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 private: | 34 private: |
35 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); | 35 explicit WebTaskRunnerImpl(scoped_refptr<TaskQueue> task_queue); |
36 ~WebTaskRunnerImpl() override; | 36 ~WebTaskRunnerImpl() override; |
37 | 37 |
38 base::TimeTicks Now() const; | 38 base::TimeTicks Now() const; |
39 | 39 |
40 scoped_refptr<TaskQueue> task_queue_; | 40 scoped_refptr<TaskQueue> task_queue_; |
41 | 41 |
42 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); | 42 DISALLOW_COPY_AND_ASSIGN(WebTaskRunnerImpl); |
43 }; | 43 }; |
44 | 44 |
45 } // namespace scheduler | 45 } // namespace scheduler |
46 } // namespace blink | 46 } // namespace blink |
47 | 47 |
48 #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 |