| OLD | NEW |
| 1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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 "cc/scheduler/delay_based_time_source.h" | 5 #include "cc/scheduler/delay_based_time_source.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // the base::TimeTicks::Now as the timebase. | 60 // the base::TimeTicks::Now as the timebase. |
| 61 scoped_refptr<DelayBasedTimeSource> DelayBasedTimeSource::Create( | 61 scoped_refptr<DelayBasedTimeSource> DelayBasedTimeSource::Create( |
| 62 base::TimeDelta interval, | 62 base::TimeDelta interval, |
| 63 base::SingleThreadTaskRunner* task_runner) { | 63 base::SingleThreadTaskRunner* task_runner) { |
| 64 return make_scoped_refptr(new DelayBasedTimeSource(interval, task_runner)); | 64 return make_scoped_refptr(new DelayBasedTimeSource(interval, task_runner)); |
| 65 } | 65 } |
| 66 | 66 |
| 67 DelayBasedTimeSource::DelayBasedTimeSource( | 67 DelayBasedTimeSource::DelayBasedTimeSource( |
| 68 base::TimeDelta interval, | 68 base::TimeDelta interval, |
| 69 base::SingleThreadTaskRunner* task_runner) | 69 base::SingleThreadTaskRunner* task_runner) |
| 70 : client_(NULL), | 70 : client_(nullptr), |
| 71 last_tick_time_(base::TimeTicks() - interval), | 71 last_tick_time_(base::TimeTicks() - interval), |
| 72 current_parameters_(interval, base::TimeTicks()), | 72 current_parameters_(interval, base::TimeTicks()), |
| 73 next_parameters_(interval, base::TimeTicks()), | 73 next_parameters_(interval, base::TimeTicks()), |
| 74 active_(false), | 74 active_(false), |
| 75 task_runner_(task_runner), | 75 task_runner_(task_runner), |
| 76 weak_factory_(this) { | 76 weak_factory_(this) { |
| 77 DCHECK_GT(interval.ToInternalValue(), 0); | 77 DCHECK_GT(interval.ToInternalValue(), 0); |
| 78 } | 78 } |
| 79 | 79 |
| 80 DelayBasedTimeSource::~DelayBasedTimeSource() {} | 80 DelayBasedTimeSource::~DelayBasedTimeSource() {} |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 state->BeginDictionary("next_parameters"); | 305 state->BeginDictionary("next_parameters"); |
| 306 state->SetDouble("interval_us", next_parameters_.interval.InMicroseconds()); | 306 state->SetDouble("interval_us", next_parameters_.interval.InMicroseconds()); |
| 307 state->SetDouble("tick_target_us", | 307 state->SetDouble("tick_target_us", |
| 308 next_parameters_.tick_target.ToInternalValue()); | 308 next_parameters_.tick_target.ToInternalValue()); |
| 309 state->EndDictionary(); | 309 state->EndDictionary(); |
| 310 | 310 |
| 311 state->SetBoolean("active", active_); | 311 state->SetBoolean("active", active_); |
| 312 } | 312 } |
| 313 | 313 |
| 314 } // namespace cc | 314 } // namespace cc |
| OLD | NEW |