diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-12 14:27:29 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2020-10-13 09:35:20 +0000 |
commit | c30a6232df03e1efbd9f3b226777b07e087a1122 (patch) | |
tree | e992f45784689f373bcc38d1b79a239ebe17ee23 /chromium/media/base/audio_renderer_mixer.cc | |
parent | 7b5b123ac58f58ffde0f4f6e488bcd09aa4decd3 (diff) | |
download | qtwebengine-chromium-85-based.tar.gz |
BASELINE: Update Chromium to 85.0.4183.14085-based
Change-Id: Iaa42f4680837c57725b1344f108c0196741f6057
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/media/base/audio_renderer_mixer.cc')
-rw-r--r-- | chromium/media/base/audio_renderer_mixer.cc | 42 |
1 files changed, 2 insertions, 40 deletions
diff --git a/chromium/media/base/audio_renderer_mixer.cc b/chromium/media/base/audio_renderer_mixer.cc index d3c1bd8c7db..d7109300027 100644 --- a/chromium/media/base/audio_renderer_mixer.cc +++ b/chromium/media/base/audio_renderer_mixer.cc @@ -24,49 +24,15 @@ namespace media { enum { kPauseDelaySeconds = 10 }; -// Tracks the maximum value of a counter and logs it into a UMA histogram upon -// each increase of the maximum. NOT thread-safe, make sure it is used under -// lock. -class AudioRendererMixer::UMAMaxValueTracker { - public: - UMAMaxValueTracker(UmaLogCallback log_callback) - : log_callback_(std::move(log_callback)), count_(0), max_count_(0) {} - - ~UMAMaxValueTracker() = default; - - // Increments the counter, updates the maximum. - void Increment() { - ++count_; - if (max_count_ < count_) { - max_count_ = count_; - log_callback_.Run(max_count_); - } - } - - // Decrements the counter. - void Decrement() { - DCHECK_GE(count_, 0); - --count_; - } - - private: - const UmaLogCallback log_callback_; - int count_; - int max_count_; - DISALLOW_COPY_AND_ASSIGN(UMAMaxValueTracker); -}; - AudioRendererMixer::AudioRendererMixer(const AudioParameters& output_params, - scoped_refptr<AudioRendererSink> sink, - UmaLogCallback log_callback) + scoped_refptr<AudioRendererSink> sink) : output_params_(output_params), audio_sink_(std::move(sink)), master_converter_(output_params, output_params, true), pause_delay_(base::TimeDelta::FromSeconds(kPauseDelaySeconds)), last_play_time_(base::TimeTicks::Now()), // Initialize |playing_| to true since Start() results in an auto-play. - playing_(true), - input_count_tracker_(new UMAMaxValueTracker(std::move(log_callback))) { + playing_(true) { DCHECK(audio_sink_); // If enabled we will disable the real audio output stream for muted/silent @@ -126,8 +92,6 @@ void AudioRendererMixer::AddMixerInput(const AudioParameters& input_params, } converter->second->AddInput(input); } - - input_count_tracker_->Increment(); } void AudioRendererMixer::RemoveMixerInput( @@ -148,8 +112,6 @@ void AudioRendererMixer::RemoveMixerInput( converters_.erase(converter); } } - - input_count_tracker_->Decrement(); } void AudioRendererMixer::AddErrorCallback(AudioRendererMixerInput* input) { |