| Index: media/capture/content/smooth_event_sampler.cc
|
| diff --git a/media/capture/content/smooth_event_sampler.cc b/media/capture/content/smooth_event_sampler.cc
|
| index 9ac263dd13fc2a8c91c30fb8a3dc22e2de1fb858..7f7297f2038192655b24528e4ae29db1778d1c53 100644
|
| --- a/media/capture/content/smooth_event_sampler.cc
|
| +++ b/media/capture/content/smooth_event_sampler.cc
|
| @@ -12,11 +12,8 @@
|
|
|
| namespace media {
|
|
|
| -SmoothEventSampler::SmoothEventSampler(base::TimeDelta min_capture_period,
|
| - int redundant_capture_goal)
|
| - : redundant_capture_goal_(redundant_capture_goal),
|
| - overdue_sample_count_(0),
|
| - token_bucket_(base::TimeDelta::Max()) {
|
| +SmoothEventSampler::SmoothEventSampler(base::TimeDelta min_capture_period)
|
| + : token_bucket_(base::TimeDelta::Max()) {
|
| SetMinCapturePeriod(min_capture_period);
|
| }
|
|
|
| @@ -59,29 +56,8 @@ void SmoothEventSampler::RecordSample() {
|
| TRACE_COUNTER1("gpu.capture", "MirroringTokenBucketUsec",
|
| std::max<int64_t>(0, token_bucket_.InMicroseconds()));
|
|
|
| - if (HasUnrecordedEvent()) {
|
| + if (HasUnrecordedEvent())
|
| last_sample_ = current_event_;
|
| - overdue_sample_count_ = 0;
|
| - } else {
|
| - ++overdue_sample_count_;
|
| - }
|
| -}
|
| -
|
| -bool SmoothEventSampler::IsOverdueForSamplingAt(
|
| - base::TimeTicks event_time) const {
|
| - DCHECK(!event_time.is_null());
|
| -
|
| - if (!HasUnrecordedEvent() && overdue_sample_count_ >= redundant_capture_goal_)
|
| - return false; // Not dirty.
|
| -
|
| - if (last_sample_.is_null())
|
| - return true;
|
| -
|
| - // If we're dirty but not yet old, then we've recently gotten updates, so we
|
| - // won't request a sample just yet.
|
| - base::TimeDelta dirty_interval = event_time - last_sample_;
|
| - return dirty_interval >=
|
| - base::TimeDelta::FromMilliseconds(OVERDUE_DIRTY_THRESHOLD_MILLIS);
|
| }
|
|
|
| bool SmoothEventSampler::HasUnrecordedEvent() const {
|
|
|