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

Unified Diff: components/payments/core/journey_logger.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: components/payments/core/journey_logger.cc
diff --git a/components/payments/core/journey_logger.cc b/components/payments/core/journey_logger.cc
index ae2d4b6a3aefb46340329da1345b66651cd6ac13..94a25e4f5ca523d4a8a0c7120a5194388b5fabed 100644
--- a/components/payments/core/journey_logger.cc
+++ b/components/payments/core/journey_logger.cc
@@ -203,8 +203,10 @@ void JourneyLogger::RecordPaymentMethodMetric() {
void JourneyLogger::RecordRequestedInformationMetrics() {
DCHECK(requested_information_ != REQUESTED_INFORMATION_MAX);
- UMA_HISTOGRAM_ENUMERATION("PaymentRequest.RequestedInformation",
- requested_information_, REQUESTED_INFORMATION_MAX);
+ UMA_HISTOGRAM_ENUMERATION(
+ "PaymentRequest.RequestedInformation",
+ static_cast<RequestedInformation>(requested_information_),
+ REQUESTED_INFORMATION_MAX);
}
void JourneyLogger::RecordSectionSpecificStats(
@@ -298,7 +300,8 @@ void JourneyLogger::RecordCanMakePaymentEffectOnShow() {
effect_on_show |= CMP_EFFECT_ON_SHOW_COULD_MAKE_PAYMENT;
UMA_HISTOGRAM_ENUMERATION("PaymentRequest.CanMakePayment.Used.EffectOnShow",
- effect_on_show, CMP_EFFECT_ON_SHOW_MAX);
+ static_cast<CmpEffectOnShow>(effect_on_show),
+ CMP_EFFECT_ON_SHOW_MAX);
}
void JourneyLogger::RecordCanMakePaymentEffectOnCompletion(

Powered by Google App Engine
This is Rietveld 408576698