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

Unified Diff: media/audio/audio_output_resampler.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: simplify type checking Created 3 years, 5 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
« no previous file with comments | « ios/chrome/today_extension/today_view_controller.mm ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/audio/audio_output_resampler.cc
diff --git a/media/audio/audio_output_resampler.cc b/media/audio/audio_output_resampler.cc
index 907955f91ee4d7107b414e7cda5c91e12ea42569..fef7815a7f5dba35f3f820370ce7cf72764143f4 100644
--- a/media/audio/audio_output_resampler.cc
+++ b/media/audio/audio_output_resampler.cc
@@ -93,19 +93,15 @@ class OnMoreDataConverter
// Record UMA statistics for hardware output configuration.
static void RecordStats(const AudioParameters& output_params) {
- // Note the 'PRESUBMIT_IGNORE_UMA_MAX's below, these silence the PRESUBMIT.py
- // check for uma enum max usage, since we're abusing UMA_HISTOGRAM_ENUMERATION
- // to report a discrete value.
- UMA_HISTOGRAM_ENUMERATION(
- "Media.HardwareAudioBitsPerChannel",
- output_params.bits_per_sample(),
- limits::kMaxBitsPerSample); // PRESUBMIT_IGNORE_UMA_MAX
+ UMA_HISTOGRAM_EXACT_LINEAR("Media.HardwareAudioBitsPerChannel",
+ output_params.bits_per_sample(),
+ static_cast<int>(limits::kMaxBitsPerSample));
UMA_HISTOGRAM_ENUMERATION(
"Media.HardwareAudioChannelLayout", output_params.channel_layout(),
CHANNEL_LAYOUT_MAX + 1);
- UMA_HISTOGRAM_ENUMERATION(
- "Media.HardwareAudioChannelCount", output_params.channels(),
- limits::kMaxChannels); // PRESUBMIT_IGNORE_UMA_MAX
+ UMA_HISTOGRAM_EXACT_LINEAR("Media.HardwareAudioChannelCount",
+ output_params.channels(),
+ static_cast<int>(limits::kMaxChannels));
AudioSampleRate asr;
if (ToAudioSampleRate(output_params.sample_rate(), &asr)) {
@@ -121,19 +117,15 @@ static void RecordStats(const AudioParameters& output_params) {
// Record UMA statistics for hardware output configuration after fallback.
static void RecordFallbackStats(const AudioParameters& output_params) {
UMA_HISTOGRAM_BOOLEAN("Media.FallbackToHighLatencyAudioPath", true);
- // Note the 'PRESUBMIT_IGNORE_UMA_MAX's below, these silence the PRESUBMIT.py
- // check for uma enum max usage, since we're abusing UMA_HISTOGRAM_ENUMERATION
- // to report a discrete value.
- UMA_HISTOGRAM_ENUMERATION(
- "Media.FallbackHardwareAudioBitsPerChannel",
- output_params.bits_per_sample(),
- limits::kMaxBitsPerSample); // PRESUBMIT_IGNORE_UMA_MAX
+ UMA_HISTOGRAM_EXACT_LINEAR("Media.FallbackHardwareAudioBitsPerChannel",
+ output_params.bits_per_sample(),
+ static_cast<int>(limits::kMaxBitsPerSample));
UMA_HISTOGRAM_ENUMERATION(
"Media.FallbackHardwareAudioChannelLayout",
output_params.channel_layout(), CHANNEL_LAYOUT_MAX + 1);
- UMA_HISTOGRAM_ENUMERATION(
- "Media.FallbackHardwareAudioChannelCount", output_params.channels(),
- limits::kMaxChannels); // PRESUBMIT_IGNORE_UMA_MAX
+ UMA_HISTOGRAM_EXACT_LINEAR("Media.FallbackHardwareAudioChannelCount",
+ output_params.channels(),
+ static_cast<int>(limits::kMaxChannels));
AudioSampleRate asr;
if (ToAudioSampleRate(output_params.sample_rate(), &asr)) {
« no previous file with comments | « ios/chrome/today_extension/today_view_controller.mm ('k') | net/dns/host_resolver_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698