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

Unified Diff: chrome/browser/diagnostics/diagnostics_test.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
Index: chrome/browser/diagnostics/diagnostics_test.cc
diff --git a/chrome/browser/diagnostics/diagnostics_test.cc b/chrome/browser/diagnostics/diagnostics_test.cc
index df5ae196a72c7a0304647fd7ecd448ff6a1bba8b..da7cc784505f4083b93ce579bb885e73592eb2cb 100644
--- a/chrome/browser/diagnostics/diagnostics_test.cc
+++ b/chrome/browser/diagnostics/diagnostics_test.cc
@@ -59,18 +59,17 @@ void DiagnosticsTest::RecordOutcome(int outcome_code,
additional_info_ = additional_info;
result_ = result;
#if defined(OS_CHROMEOS) // Only collecting UMA stats on ChromeOS
+ DiagnosticsTestId id = static_cast<DiagnosticsTestId>(GetId());
if (result_ == DiagnosticsModel::TEST_OK) {
// Record individual test success.
- RecordUMATestResult(static_cast<DiagnosticsTestId>(GetId()),
- RESULT_SUCCESS);
+ RecordUMATestResult(id, RESULT_SUCCESS);
} else if (result_ == DiagnosticsModel::TEST_FAIL_CONTINUE ||
result_ == DiagnosticsModel::TEST_FAIL_STOP) {
// Record test failure in summary histogram.
- UMA_HISTOGRAM_ENUMERATION(
- "Diagnostics.TestFailures", GetId(), DIAGNOSTICS_TEST_ID_COUNT);
+ UMA_HISTOGRAM_ENUMERATION("Diagnostics.TestFailures", id,
+ DIAGNOSTICS_TEST_ID_COUNT);
// Record individual test failure.
- RecordUMATestResult(static_cast<DiagnosticsTestId>(GetId()),
- RESULT_FAILURE);
+ RecordUMATestResult(id, RESULT_FAILURE);
}
#endif
}
« no previous file with comments | « chrome/browser/chromeos/policy/upload_job_impl.cc ('k') | chrome/browser/engagement/important_sites_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698