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

Unified Diff: content/browser/download/download_stats.cc

Issue 2886933003: Use stricter type checking in UMA_HISTOGRAM_ENUMERATION (Closed)
Patch Set: nocompile test Created 3 years, 7 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: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index ea49d2da425ca54d2bf1a2ebee2c2b918853b4ef..797e94a52623221b76ef9588f22ee70f04ef6220 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -914,11 +914,13 @@ void RecordSavePackageEvent(SavePackageEvent event) {
void RecordOriginStateOnResumption(bool is_partial,
int state) {
if (is_partial)
- UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnPartialResumption", state,
- ORIGIN_STATE_ON_RESUMPTION_MAX);
+ UMA_HISTOGRAM_EXACT_LINEAR(
+ "Download.OriginStateOnPartialResumption", state,
+ static_cast<int>(ORIGIN_STATE_ON_RESUMPTION_MAX));
Alexei Svitkine (slow) 2017/05/31 20:22:24 But these are actual enums, as defined in XML. I
wychen 2017/07/14 23:18:44 Fixed. Some static casts are still needed because
else
- UMA_HISTOGRAM_ENUMERATION("Download.OriginStateOnFullResumption", state,
- ORIGIN_STATE_ON_RESUMPTION_MAX);
+ UMA_HISTOGRAM_EXACT_LINEAR(
+ "Download.OriginStateOnFullResumption", state,
+ static_cast<int>(ORIGIN_STATE_ON_RESUMPTION_MAX));
}
namespace {

Powered by Google App Engine
This is Rietveld 408576698