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_BASE_REAL_TIME_DOMAIN_H_ | 5 #ifndef COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ |
6 #define COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ | 6 #define COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "components/scheduler/base/time_domain.h" | 11 #include "components/scheduler/base/time_domain.h" |
12 #include "components/scheduler/scheduler_export.h" | 12 #include "components/scheduler/scheduler_export.h" |
13 | 13 |
14 namespace scheduler { | 14 namespace scheduler { |
15 | 15 |
16 class SCHEDULER_EXPORT RealTimeDomain : public TimeDomain { | 16 class SCHEDULER_EXPORT RealTimeDomain : public TimeDomain { |
17 public: | 17 public: |
18 RealTimeDomain(); | 18 RealTimeDomain(); |
19 ~RealTimeDomain() override; | 19 ~RealTimeDomain() override; |
20 | 20 |
21 // TimeDomain implementation: | 21 // TimeDomain implementation: |
22 LazyNow CreateLazyNow() const override; | 22 LazyNow CreateLazyNow() const override; |
23 base::TimeTicks Now() const override; | 23 base::TimeTicks Now() const override; |
24 base::TimeTicks ComputeDelayedRunTime(base::TimeTicks time_domain_now, | |
25 base::TimeDelta delay) const override; | |
26 bool MaybeAdvanceTime() override; | 24 bool MaybeAdvanceTime() override; |
27 const char* GetName() const override; | 25 const char* GetName() const override; |
28 | 26 |
29 protected: | 27 protected: |
30 void OnRegisterWithTaskQueueManager( | 28 void OnRegisterWithTaskQueueManager( |
31 TaskQueueManager* task_queue_manager) override; | 29 TaskQueueManager* task_queue_manager) override; |
32 void RequestWakeup(base::TimeTicks now, base::TimeDelta delay) override; | 30 void RequestWakeup(base::TimeTicks now, base::TimeDelta delay) override; |
33 void AsValueIntoInternal( | 31 void AsValueIntoInternal( |
34 base::trace_event::TracedValue* state) const override; | 32 base::trace_event::TracedValue* state) const override; |
35 | 33 |
36 private: | 34 private: |
37 TaskQueueManager* task_queue_manager_; // NOT OWNED | 35 TaskQueueManager* task_queue_manager_; // NOT OWNED |
38 | 36 |
39 DISALLOW_COPY_AND_ASSIGN(RealTimeDomain); | 37 DISALLOW_COPY_AND_ASSIGN(RealTimeDomain); |
40 }; | 38 }; |
41 | 39 |
42 } // namespace scheduler | 40 } // namespace scheduler |
43 | 41 |
44 #endif // COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ | 42 #endif // COMPONENTS_SCHEDULER_BASE_REAL_TIME_DOMAIN_H_ |
OLD | NEW |