| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "media/capture/content/smooth_event_sampler.h" | 5 #include "media/capture/content/smooth_event_sampler.h" |
| 6 | 6 |
| 7 #include <stdint.h> |
| 8 |
| 7 #include <algorithm> | 9 #include <algorithm> |
| 8 | 10 |
| 9 #include "base/trace_event/trace_event.h" | 11 #include "base/trace_event/trace_event.h" |
| 10 | 12 |
| 11 namespace media { | 13 namespace media { |
| 12 | 14 |
| 13 SmoothEventSampler::SmoothEventSampler(base::TimeDelta min_capture_period, | 15 SmoothEventSampler::SmoothEventSampler(base::TimeDelta min_capture_period, |
| 14 int redundant_capture_goal) | 16 int redundant_capture_goal) |
| 15 : redundant_capture_goal_(redundant_capture_goal), | 17 : redundant_capture_goal_(redundant_capture_goal), |
| 16 overdue_sample_count_(0), | 18 overdue_sample_count_(0), |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 base::TimeDelta dirty_interval = event_time - last_sample_; | 82 base::TimeDelta dirty_interval = event_time - last_sample_; |
| 81 return dirty_interval >= | 83 return dirty_interval >= |
| 82 base::TimeDelta::FromMilliseconds(OVERDUE_DIRTY_THRESHOLD_MILLIS); | 84 base::TimeDelta::FromMilliseconds(OVERDUE_DIRTY_THRESHOLD_MILLIS); |
| 83 } | 85 } |
| 84 | 86 |
| 85 bool SmoothEventSampler::HasUnrecordedEvent() const { | 87 bool SmoothEventSampler::HasUnrecordedEvent() const { |
| 86 return !current_event_.is_null() && current_event_ != last_sample_; | 88 return !current_event_.is_null() && current_event_ != last_sample_; |
| 87 } | 89 } |
| 88 | 90 |
| 89 } // namespace media | 91 } // namespace media |
| OLD | NEW |