Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(80)

Unified Diff: media/audio/linux/audio_manager_linux.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: media/audio/linux/audio_manager_linux.cc
diff --git a/media/audio/linux/audio_manager_linux.cc b/media/audio/linux/audio_manager_linux.cc
index eaeb2f332b94d2de40143f976675828069328b4a..e7824b4d6c8d03c7904da79b480213b7d96ed07f 100644
--- a/media/audio/linux/audio_manager_linux.cc
+++ b/media/audio/linux/audio_manager_linux.cc
@@ -23,13 +23,13 @@ enum LinuxAudioIO {
kPulse,
kAlsa,
kCras,
- kAudioIOMax // Must always be last!
+ kAudioIOMax = kCras // Must always be equal to largest logged entry.
};
AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) {
#if defined(USE_CRAS)
if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUseCras)) {
- UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax);
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kCras, kAudioIOMax + 1);
return new AudioManagerCras(audio_log_factory);
}
#endif
@@ -37,13 +37,13 @@ AudioManager* CreateAudioManager(AudioLogFactory* audio_log_factory) {
#if defined(USE_PULSEAUDIO)
AudioManager* manager = AudioManagerPulse::Create(audio_log_factory);
if (manager) {
- UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kPulse, kAudioIOMax);
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kPulse, kAudioIOMax + 1);
return manager;
}
#endif
#if defined(USE_ALSA)
- UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kAlsa, kAudioIOMax);
+ UMA_HISTOGRAM_ENUMERATION("Media.LinuxAudioIO", kAlsa, kAudioIOMax + 1);
return new AudioManagerAlsa(audio_log_factory);
#else
return new FakeAudioManager(audio_log_factory);

Powered by Google App Engine
This is Rietveld 408576698