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 #include "platform/scheduler/base/virtual_time_domain.h" | 5 #include "platform/scheduler/base/virtual_time_domain.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "platform/scheduler/base/task_queue_impl.h" | 8 #include "platform/scheduler/base/task_queue_impl.h" |
9 #include "platform/scheduler/base/task_queue_manager.h" | 9 #include "platform/scheduler/base/task_queue_manager.h" |
10 #include "platform/scheduler/base/task_queue_manager_delegate.h" | 10 #include "platform/scheduler/base/task_queue_manager_delegate.h" |
(...skipping 16 matching lines...) Expand all Loading... | |
27 LazyNow VirtualTimeDomain::CreateLazyNow() const { | 27 LazyNow VirtualTimeDomain::CreateLazyNow() const { |
28 base::AutoLock lock(lock_); | 28 base::AutoLock lock(lock_); |
29 return LazyNow(now_); | 29 return LazyNow(now_); |
30 } | 30 } |
31 | 31 |
32 base::TimeTicks VirtualTimeDomain::Now() const { | 32 base::TimeTicks VirtualTimeDomain::Now() const { |
33 base::AutoLock lock(lock_); | 33 base::AutoLock lock(lock_); |
34 return now_; | 34 return now_; |
35 } | 35 } |
36 | 36 |
37 void VirtualTimeDomain::RequestWakeup(base::TimeTicks now, | 37 void VirtualTimeDomain::RequestWakeupAt(LazyNow* lazy_now, |
38 base::TimeDelta delay) { | 38 base::TimeTicks run_time) { |
39 // We don't need to do anything here because the caller of AdvanceTo is | 39 // We don't need to do anything here because the caller of AdvanceTo is |
40 // responsible for calling TaskQueueManager::MaybeScheduleImmediateWork if | 40 // responsible for calling TaskQueueManager::MaybeScheduleImmediateWork if |
41 // needed. | 41 // needed. |
42 } | 42 } |
43 | 43 |
44 void VirtualTimeDomain::CancelWakeupAt(base::TimeTicks run_time) {} | |
Sami
2016/12/14 16:29:38
// No-op because of the above.
?
alex clarke (OOO till 29th)
2016/12/14 16:50:36
Done.
| |
45 | |
44 base::Optional<base::TimeDelta> VirtualTimeDomain::DelayTillNextTask( | 46 base::Optional<base::TimeDelta> VirtualTimeDomain::DelayTillNextTask( |
45 LazyNow* lazy_now) { | 47 LazyNow* lazy_now) { |
46 return base::Optional<base::TimeDelta>(); | 48 return base::Optional<base::TimeDelta>(); |
47 } | 49 } |
48 | 50 |
49 void VirtualTimeDomain::AsValueIntoInternal( | 51 void VirtualTimeDomain::AsValueIntoInternal( |
50 base::trace_event::TracedValue* state) const {} | 52 base::trace_event::TracedValue* state) const {} |
51 | 53 |
52 void VirtualTimeDomain::AdvanceTo(base::TimeTicks now) { | 54 void VirtualTimeDomain::AdvanceTo(base::TimeTicks now) { |
53 base::AutoLock lock(lock_); | 55 base::AutoLock lock(lock_); |
54 DCHECK_GE(now, now_); | 56 DCHECK_GE(now, now_); |
55 now_ = now; | 57 now_ = now; |
56 } | 58 } |
57 | 59 |
58 void VirtualTimeDomain::RequestDoWork() { | 60 void VirtualTimeDomain::RequestDoWork() { |
59 task_queue_manager_->MaybeScheduleImmediateWork(FROM_HERE); | 61 task_queue_manager_->MaybeScheduleImmediateWork(FROM_HERE); |
60 } | 62 } |
61 | 63 |
62 const char* VirtualTimeDomain::GetName() const { | 64 const char* VirtualTimeDomain::GetName() const { |
63 return "VirtualTimeDomain"; | 65 return "VirtualTimeDomain"; |
64 } | 66 } |
65 | 67 |
66 } // namespace scheduler | 68 } // namespace scheduler |
67 } // namespace blink | 69 } // namespace blink |
OLD | NEW |