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

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

Issue 2155143002: Fix a bug that could occasionaly cause setInterval to stop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 months 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 "components/scheduler/base/real_time_domain.h" 5 #include "components/scheduler/base/real_time_domain.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/scheduler/base/task_queue_impl.h" 8 #include "components/scheduler/base/task_queue_impl.h"
9 #include "components/scheduler/base/task_queue_manager.h" 9 #include "components/scheduler/base/task_queue_manager.h"
10 #include "components/scheduler/base/task_queue_manager_delegate.h" 10 #include "components/scheduler/base/task_queue_manager_delegate.h"
(...skipping 14 matching lines...) Expand all
25 } 25 }
26 26
27 LazyNow RealTimeDomain::CreateLazyNow() const { 27 LazyNow RealTimeDomain::CreateLazyNow() const {
28 return task_queue_manager_->CreateLazyNow(); 28 return task_queue_manager_->CreateLazyNow();
29 } 29 }
30 30
31 base::TimeTicks RealTimeDomain::Now() const { 31 base::TimeTicks RealTimeDomain::Now() const {
32 return task_queue_manager_->delegate()->NowTicks(); 32 return task_queue_manager_->delegate()->NowTicks();
33 } 33 }
34 34
35 base::TimeTicks RealTimeDomain::ComputeDelayedRunTime( 35 base::TimeTicks RealTimeDomain::BlinkNow() const {
36 base::TimeTicks time_domain_now, 36 return task_queue_manager_->delegate()->NowTicks();
37 base::TimeDelta delay) const {
38 return time_domain_now + delay;
39 } 37 }
40 38
41 void RealTimeDomain::RequestWakeup(base::TimeTicks now, base::TimeDelta delay) { 39 void RealTimeDomain::RequestWakeup(base::TimeTicks now, base::TimeDelta delay) {
42 // NOTE this is only called if the scheduled runtime is sooner than any 40 // NOTE this is only called if the scheduled runtime is sooner than any
43 // previously scheduled runtime, or there is no (outstanding) previously 41 // previously scheduled runtime, or there is no (outstanding) previously
44 // scheduled runtime. 42 // scheduled runtime.
45 task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay); 43 task_queue_manager_->MaybeScheduleDelayedWork(FROM_HERE, now, delay);
46 } 44 }
47 45
48 bool RealTimeDomain::MaybeAdvanceTime() { 46 bool RealTimeDomain::MaybeAdvanceTime() {
(...skipping 15 matching lines...) Expand all
64 return false; 62 return false;
65 } 63 }
66 64
67 void RealTimeDomain::AsValueIntoInternal( 65 void RealTimeDomain::AsValueIntoInternal(
68 base::trace_event::TracedValue* state) const {} 66 base::trace_event::TracedValue* state) const {}
69 67
70 const char* RealTimeDomain::GetName() const { 68 const char* RealTimeDomain::GetName() const {
71 return "RealTimeDomain"; 69 return "RealTimeDomain";
72 } 70 }
73 } // namespace scheduler 71 } // namespace scheduler
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698