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

Unified Diff: chrome/browser/autofill/autofill_cc_infobar_delegate.cc

Issue 780423002: Don't deref stale AutofillMetrics pointer in AutofillCCInfoBarDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: static-ify Created 6 years 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/autofill/autofill_cc_infobar_delegate.cc
diff --git a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
index f2fd9ea8d0e636e17b3b0e6409ad247c578504f4..a44a1b3a51eefbfbf763642e87dd540cf8f4bf58 100644
--- a/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
+++ b/chrome/browser/autofill/autofill_cc_infobar_delegate.cc
@@ -24,21 +24,18 @@ namespace autofill {
// static
void AutofillCCInfoBarDelegate::Create(
InfoBarService* infobar_service,
- const AutofillMetrics* metric_logger,
const base::Closure& save_card_callback) {
- infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar(
- scoped_ptr<ConfirmInfoBarDelegate>(new AutofillCCInfoBarDelegate(
- metric_logger, save_card_callback))));
+ infobar_service->AddInfoBar(
+ ConfirmInfoBarDelegate::CreateInfoBar(scoped_ptr<ConfirmInfoBarDelegate>(
+ new AutofillCCInfoBarDelegate(save_card_callback))));
}
AutofillCCInfoBarDelegate::AutofillCCInfoBarDelegate(
- const AutofillMetrics* metric_logger,
const base::Closure& save_card_callback)
: ConfirmInfoBarDelegate(),
- metric_logger_(metric_logger),
save_card_callback_(save_card_callback),
had_user_interaction_(false) {
- metric_logger->LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN);
+ AutofillMetrics::LogCreditCardInfoBarMetric(AutofillMetrics::INFOBAR_SHOWN);
}
AutofillCCInfoBarDelegate::~AutofillCCInfoBarDelegate() {
@@ -50,7 +47,7 @@ void AutofillCCInfoBarDelegate::LogUserAction(
AutofillMetrics::InfoBarMetric user_action) {
DCHECK(!had_user_interaction_);
- metric_logger_->LogCreditCardInfoBarMetric(user_action);
+ AutofillMetrics::LogCreditCardInfoBarMetric(user_action);
had_user_interaction_ = true;
}

Powered by Google App Engine
This is Rietveld 408576698