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

Unified Diff: media/filters/stream_parser_factory.cc

Issue 148553003: Clean up histogram'd media enum max values. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FOO_MAX = LAST_VALID_FOO Created 6 years, 11 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
« media/base/channel_layout.cc ('K') | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/filters/stream_parser_factory.cc
diff --git a/media/filters/stream_parser_factory.cc b/media/filters/stream_parser_factory.cc
index 6b22f4d0f934a5d56d3e11d755bb282d66df3d80..9bcad5b928a10d75e0ebf25ec8881bba48bf35a2 100644
--- a/media/filters/stream_parser_factory.cc
+++ b/media/filters/stream_parser_factory.cc
@@ -49,7 +49,7 @@ struct CodecInfo {
HISTOGRAM_EAC3,
HISTOGRAM_MP3,
HISTOGRAM_OPUS,
- HISTOGRAM_MAX // Must be the last entry.
+ HISTOGRAM_MAX = HISTOGRAM_OPUS // Must be equal to last entry!
rileya (GONE FROM CHROMIUM) 2014/01/29 19:24:11 HISTOGRAM_MAX now seems like kind of a misnomer, a
Ami GONE FROM CHROMIUM 2014/01/29 21:29:02 Can this enum type be replaced with a union of aud
};
const char* pattern;
@@ -397,12 +397,14 @@ scoped_ptr<StreamParser> StreamParserFactory::Create(
// Log the number of codecs specified, as well as the details on each one.
UMA_HISTOGRAM_COUNTS_100("Media.MSE.NumberOfTracks", codecs.size());
for (size_t i = 0; i < audio_codecs.size(); ++i) {
- UMA_HISTOGRAM_ENUMERATION(
- "Media.MSE.AudioCodec", audio_codecs[i], CodecInfo::HISTOGRAM_MAX);
+ UMA_HISTOGRAM_ENUMERATION("Media.MSE.AudioCodec",
+ audio_codecs[i],
+ CodecInfo::HISTOGRAM_MAX + 1);
}
for (size_t i = 0; i < video_codecs.size(); ++i) {
- UMA_HISTOGRAM_ENUMERATION(
- "Media.MSE.VideoCodec", video_codecs[i], CodecInfo::HISTOGRAM_MAX);
+ UMA_HISTOGRAM_ENUMERATION("Media.MSE.VideoCodec",
+ video_codecs[i],
+ CodecInfo::HISTOGRAM_MAX + 1);
}
stream_parser.reset(factory_function(codecs, log_cb));
« media/base/channel_layout.cc ('K') | « media/filters/gpu_video_decoder.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698