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

Side by Side Diff: third_party/WebKit/Source/platform/scheduler/base/virtual_time_domain.cc

Issue 2546423002: [Try # 3] Scheduler refactoring to virtually eliminate redundant DoWorks (Closed)
Patch Set: Few tweaks Created 4 years 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
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 23 matching lines...) Expand all
34 return now_; 34 return now_;
35 } 35 }
36 36
37 void VirtualTimeDomain::RequestWakeup(base::TimeTicks now, 37 void VirtualTimeDomain::RequestWakeup(base::TimeTicks now,
38 base::TimeDelta delay) { 38 base::TimeDelta delay) {
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 bool VirtualTimeDomain::MaybeAdvanceTime() { 44 base::Optional<base::TimeDelta> VirtualTimeDomain::DelayTillNextTask(
45 return false; 45 LazyNow* lazy_now) {
46 return base::Optional<base::TimeDelta>();
46 } 47 }
47 48
48 void VirtualTimeDomain::AsValueIntoInternal( 49 void VirtualTimeDomain::AsValueIntoInternal(
49 base::trace_event::TracedValue* state) const {} 50 base::trace_event::TracedValue* state) const {}
50 51
51 void VirtualTimeDomain::AdvanceTo(base::TimeTicks now) { 52 void VirtualTimeDomain::AdvanceTo(base::TimeTicks now) {
52 base::AutoLock lock(lock_); 53 base::AutoLock lock(lock_);
53 DCHECK_GE(now, now_); 54 DCHECK_GE(now, now_);
54 now_ = now; 55 now_ = now;
55 } 56 }
56 57
57 void VirtualTimeDomain::RequestDoWork() { 58 void VirtualTimeDomain::RequestDoWork() {
58 task_queue_manager_->MaybeScheduleImmediateWork(FROM_HERE); 59 task_queue_manager_->MaybeScheduleImmediateWork(FROM_HERE);
59 } 60 }
60 61
61 const char* VirtualTimeDomain::GetName() const { 62 const char* VirtualTimeDomain::GetName() const {
62 return "VirtualTimeDomain"; 63 return "VirtualTimeDomain";
63 } 64 }
64 65
65 } // namespace scheduler 66 } // namespace scheduler
66 } // namespace blink 67 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698