Chromium Code Reviews| Index: components/payments/core/journey_logger.cc |
| diff --git a/components/payments/core/journey_logger.cc b/components/payments/core/journey_logger.cc |
| index dc25cf6f1bf460dd3d7f797e7100f60d914ffbb8..ea58dd1c9643a5cad549660f2df93955a835eccd 100644 |
| --- a/components/payments/core/journey_logger.cc |
| +++ b/components/payments/core/journey_logger.cc |
| @@ -73,7 +73,8 @@ JourneyLogger::JourneyLogger(bool is_incognito, |
| is_incognito_(is_incognito), |
| events_(EVENT_INITIATED), |
| url_(url), |
| - ukm_service_(ukm_service) {} |
| + ukm_service_(ukm_service), |
| + has_recorded_(false) {} |
| JourneyLogger::~JourneyLogger() {} |
| @@ -113,6 +114,12 @@ void JourneyLogger::SetEventOccurred(Event event) { |
| void JourneyLogger::RecordJourneyStatsHistograms( |
| CompletionStatus completion_status) { |
| + // TODO: This should be a DCHECK once we make sure it's not called twice. |
|
Mathieu
2017/05/02 20:56:47
Making it a DCHECK now seems reasonable?
sebsg
2017/05/02 22:15:08
It's not fixed at the moment, so the DCHECK would
|
| + if (has_recorded_) |
| + return; |
| + |
| + has_recorded_ = true; |
| + |
| RecordSectionSpecificStats(completion_status); |
| // Record the CanMakePayment metrics based on whether the transaction was |