Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(311)

Side by Side Diff: components/scheduler/base/virtual_time_domain.cc

Issue 1432263002: (reland) Adds TimeDomains to the TaskQueueManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Forgot to change VirtualTimeDomain::GetName Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "components/scheduler/base/virtual_time_domain.h"
6
7 #include "base/bind.h"
8 #include "components/scheduler/base/task_queue_impl.h"
9 #include "components/scheduler/base/task_queue_manager_delegate.h"
10
11 namespace scheduler {
12
13 VirtualTimeDomain::VirtualTimeDomain(base::TimeTicks initial_time)
14 : now_(initial_time) {}
15
16 VirtualTimeDomain::~VirtualTimeDomain() {}
17
18 LazyNow VirtualTimeDomain::GetLazyNow() {
19 return LazyNow(now_);
20 }
21
22 void VirtualTimeDomain::RequestWakeup(base::TimeDelta delay) {
23 // We don't need to do anything here because AdvanceTo triggers delayed tasks.
24 }
25
26 bool VirtualTimeDomain::MaybeAdvanceTime() {
27 return false;
28 }
29
30 void VirtualTimeDomain::AsValueIntoInternal(
31 base::trace_event::TracedValue* state) const {}
32
33 void VirtualTimeDomain::AdvanceTo(base::TimeTicks now) {
34 DCHECK_GE(now, now_);
35 now_ = now;
36 LazyNow lazy_now(now_);
37 WakeupReadyDelayedQueues(&lazy_now);
38 }
39
40 const char* VirtualTimeDomain::GetName() const {
41 return "VirtualTimeDomain";
42 }
43
44 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698