diff options
author | gab <gab@chromium.org> | 2014-12-08 13:54:09 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-08 21:54:30 +0000 |
commit | ce7cfee334855215412460f91fd4d0f29b5e4afb (patch) | |
tree | 622bd71263d1f5e7e9081d180147d3a1938bb437 /components | |
parent | 6b150518257d898af57991939f9481bc3e95b5e7 (diff) | |
download | chromium_src-ce7cfee334855215412460f91fd4d0f29b5e4afb.zip chromium_src-ce7cfee334855215412460f91fd4d0f29b5e4afb.tar.gz chromium_src-ce7cfee334855215412460f91fd4d0f29b5e4afb.tar.bz2 |
Revert of Revert of Don't deref stale AutofillMetrics pointer in AutofillCCInfoBarDelegate (patchset #1 id:1 of https://codereview.chromium.org/790543002/)
Reason for revert:
Re-landing, revert didn't fix Win7 bots..
Original issue's description:
> Revert of Don't deref stale AutofillMetrics pointer in AutofillCCInfoBarDelegate (patchset #2 id:20001 of https://codereview.chromium.org/780423002/)
>
> Reason for revert:
> Suspected cause of flakines on Win7-bots, see http://crbug.com/440060 for details.
>
> Original issue's description:
> > Don't deref stale AutofillMetrics pointer in AutofillCCInfoBarDelegate
> >
> > It was only by luck that this used to work. After a recent refactoring, the destruction order changed and the AutofillMetrics object no longer outlasts the infobar. AutofillMetrics doesn't need to be an instance object; make the relevant function a static instead.
> >
> > TBR=sgurun@chromium.org
> > BUG=439551, 439620
> >
> > Committed: https://crrev.com/19ece1e4af5207b92c2152395dfccca1683504e1
> > Cr-Commit-Position: refs/heads/master@{#307128}
>
> TBR=isherman@chromium.org,pkasting@chromium.org,estade@chromium.org
> NOTREECHECKS=true
> NOTRY=true
> BUG=439551, 439620
>
> Committed: https://crrev.com/051aca46ed1dec4f040c9a3d7dac2af60df2db6c
> Cr-Commit-Position: refs/heads/master@{#307303}
TBR=isherman@chromium.org,pkasting@chromium.org,estade@chromium.org
NOTREECHECKS=true
NOTRY=true
BUG=439551, 439620, 440060
Review URL: https://codereview.chromium.org/782353002
Cr-Commit-Position: refs/heads/master@{#307345}
Diffstat (limited to 'components')
6 files changed, 4 insertions, 7 deletions
diff --git a/components/autofill/core/browser/autofill_client.h b/components/autofill/core/browser/autofill_client.h index e99a28e..8cba62c 100644 --- a/components/autofill/core/browser/autofill_client.h +++ b/components/autofill/core/browser/autofill_client.h @@ -79,7 +79,6 @@ class AutofillClient { // Run |save_card_callback| if the credit card should be imported as personal // data. |metric_logger| can be used to log user actions. virtual void ConfirmSaveCreditCard( - const AutofillMetrics& metric_logger, const base::Closure& save_card_callback) = 0; // Returns true if both the platform and the device support scanning credit diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc index be7ce13..3a23c99 100644 --- a/components/autofill/core/browser/autofill_manager.cc +++ b/components/autofill/core/browser/autofill_manager.cc @@ -707,7 +707,6 @@ void AutofillManager::ImportFormData(const FormStructure& submitted_form) { // save it. if (imported_credit_card) { client_->ConfirmSaveCreditCard( - *metric_logger_, base::Bind( base::IgnoreResult(&PersonalDataManager::SaveImportedCreditCard), base::Unretained(personal_data_), diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc index c3a271a..b1ea0d9 100644 --- a/components/autofill/core/browser/autofill_metrics.cc +++ b/components/autofill/core/browser/autofill_metrics.cc @@ -265,7 +265,8 @@ AutofillMetrics::AutofillMetrics() { AutofillMetrics::~AutofillMetrics() { } -void AutofillMetrics::LogCreditCardInfoBarMetric(InfoBarMetric metric) const { +// static +void AutofillMetrics::LogCreditCardInfoBarMetric(InfoBarMetric metric) { DCHECK_LT(metric, NUM_INFO_BAR_METRICS); UMA_HISTOGRAM_ENUMERATION("Autofill.CreditCardInfoBar", metric, NUM_INFO_BAR_METRICS); diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h index 68fb824..b02d339 100644 --- a/components/autofill/core/browser/autofill_metrics.h +++ b/components/autofill/core/browser/autofill_metrics.h @@ -310,7 +310,7 @@ class AutofillMetrics { AutofillMetrics(); virtual ~AutofillMetrics(); - virtual void LogCreditCardInfoBarMetric(InfoBarMetric metric) const; + static void LogCreditCardInfoBarMetric(InfoBarMetric metric); virtual void LogDeveloperEngagementMetric( DeveloperEngagementMetric metric) const; diff --git a/components/autofill/core/browser/test_autofill_client.cc b/components/autofill/core/browser/test_autofill_client.cc index 53adfd8..dec427b 100644 --- a/components/autofill/core/browser/test_autofill_client.cc +++ b/components/autofill/core/browser/test_autofill_client.cc @@ -32,7 +32,6 @@ void TestAutofillClient::ShowAutofillSettings() { } void TestAutofillClient::ConfirmSaveCreditCard( - const AutofillMetrics& metric_logger, const base::Closure& save_card_callback) { } diff --git a/components/autofill/core/browser/test_autofill_client.h b/components/autofill/core/browser/test_autofill_client.h index 5266d8b..ed0290a 100644 --- a/components/autofill/core/browser/test_autofill_client.h +++ b/components/autofill/core/browser/test_autofill_client.h @@ -25,8 +25,7 @@ class TestAutofillClient : public AutofillClient { PrefService* GetPrefs() override; void HideRequestAutocompleteDialog() override; void ShowAutofillSettings() override; - void ConfirmSaveCreditCard(const AutofillMetrics& metric_logger, - const base::Closure& save_card_callback) override; + void ConfirmSaveCreditCard(const base::Closure& save_card_callback) override; bool HasCreditCardScanFeature() override; void ScanCreditCard(const CreditCardScanCallback& callback) override; void ShowRequestAutocompleteDialog(const FormData& form, |