Index: media/base/audio_renderer_mixer.h |
diff --git a/media/base/audio_renderer_mixer.h b/media/base/audio_renderer_mixer.h |
index bdffef24b6e63a9ec239b8012cdf6dc95b4ca594..0198d61c784d897942e02595815aa6ffc90f5c07 100644 |
--- a/media/base/audio_renderer_mixer.h |
+++ b/media/base/audio_renderer_mixer.h |
@@ -26,8 +26,11 @@ namespace media { |
class MEDIA_EXPORT AudioRendererMixer |
: NON_EXPORTED_BASE(public AudioRendererSink::RenderCallback) { |
public: |
+ typedef base::Callback<void(int)> UmaLogCallback; |
+ |
AudioRendererMixer(const AudioParameters& output_params, |
- scoped_refptr<AudioRendererSink> sink); |
+ scoped_refptr<AudioRendererSink> sink, |
+ const UmaLogCallback& log_callback); |
~AudioRendererMixer() override; |
// Add or remove a mixer input from mixing; called by AudioRendererMixerInput. |
@@ -51,7 +54,13 @@ class MEDIA_EXPORT AudioRendererMixer |
// Returns true if called on rendering thread, otherwise false. |
bool CurrentThreadIsRenderingThread(); |
+ void LogLifetimeUmaStats(); |
+ |
+ const AudioParameters& GetOutputParamsForTesting() { return output_params_; }; |
+ |
private: |
+ class UMAMaxValueTracker; |
+ |
// Maps input sample rate to the dedicated converter. |
using AudioConvertersMap = |
std::map<int, std::unique_ptr<LoopbackAudioConverter>>; |
@@ -94,6 +103,10 @@ class MEDIA_EXPORT AudioRendererMixer |
base::TimeTicks last_play_time_; |
bool playing_; |
+ // Tracks the maximum number of simultaneous mixer inputs and logs it into |
+ // UMA histogram upon the destruction. |
+ std::unique_ptr<UMAMaxValueTracker> input_count_tracker_; |
+ |
DISALLOW_COPY_AND_ASSIGN(AudioRendererMixer); |
}; |