summaryrefslogtreecommitdiffstats
path: root/components/autofill/core
diff options
context:
space:
mode:
authordvadym <dvadym@chromium.org>2015-04-02 22:22:13 -0700
committerCommit bot <commit-bot@chromium.org>2015-04-03 05:23:37 +0000
commitebd6ad8ae3d26610397aee153fb5cb5e6629ce36 (patch)
tree9402df11f36d86bc6436a5e1ef69b9f668c04a55 /components/autofill/core
parent4559d0b33ec59fece09a88c78880ca4d8462d180 (diff)
downloadchromium_src-ebd6ad8ae3d26610397aee153fb5cb5e6629ce36.zip
chromium_src-ebd6ad8ae3d26610397aee153fb5cb5e6629ce36.tar.gz
chromium_src-ebd6ad8ae3d26610397aee153fb5cb5e6629ce36.tar.bz2
Added UMA statistics for estimating increase of Autofill server traffic if we omit condition on minimum number of fields for password forms.
BUG=470874 Review URL: https://codereview.chromium.org/1043503003 Cr-Commit-Position: refs/heads/master@{#323620}
Diffstat (limited to 'components/autofill/core')
-rw-r--r--components/autofill/core/browser/autofill_manager.cc14
-rw-r--r--components/autofill/core/browser/autofill_metrics.cc6
-rw-r--r--components/autofill/core/browser/autofill_metrics.h12
-rw-r--r--components/autofill/core/browser/form_structure.h2
4 files changed, 31 insertions, 3 deletions
diff --git a/components/autofill/core/browser/autofill_manager.cc b/components/autofill/core/browser/autofill_manager.cc
index 2f7f346..8e0a75d 100644
--- a/components/autofill/core/browser/autofill_manager.cc
+++ b/components/autofill/core/browser/autofill_manager.cc
@@ -1389,14 +1389,22 @@ void AutofillManager::ParseForms(const std::vector<FormData>& forms) {
for (std::vector<FormData>::const_iterator iter = forms.begin();
iter != forms.end(); ++iter) {
scoped_ptr<FormStructure> form_structure(new FormStructure(*iter));
- if (!form_structure->ShouldBeParsed())
+
+ if (!form_structure->ShouldBeParsed()) {
+ if (form_structure->has_password_field()) {
+ AutofillMetrics::LogPasswordFormQueryVolume(
+ AutofillMetrics::NEW_PASSWORD_QUERY);
+ }
continue;
+ }
form_structure->DetermineHeuristicTypes();
- if (form_structure->ShouldBeCrowdsourced())
+ if (form_structure->ShouldBeCrowdsourced()) {
+ AutofillMetrics::LogPasswordFormQueryVolume(
+ AutofillMetrics::CURRENT_QUERY);
form_structures_.push_back(form_structure.release());
- else
+ } else
non_queryable_forms.push_back(form_structure.release());
}
diff --git a/components/autofill/core/browser/autofill_metrics.cc b/components/autofill/core/browser/autofill_metrics.cc
index 2e79535..ebf5a6d 100644
--- a/components/autofill/core/browser/autofill_metrics.cc
+++ b/components/autofill/core/browser/autofill_metrics.cc
@@ -606,6 +606,12 @@ void AutofillMetrics::LogAddressSuggestionsCount(size_t num_suggestions) {
UMA_HISTOGRAM_COUNTS("Autofill.AddressSuggestionsCount", num_suggestions);
}
+void AutofillMetrics::LogPasswordFormQueryVolume(
+ PasswordFormQueryVolumeMetric metric) {
+ UMA_HISTOGRAM_ENUMERATION("Autofill.PasswordFormQueryVolume", metric,
+ NUM_PASSWORD_FORM_QUERY_VOLUME_METRIC);
+}
+
AutofillMetrics::FormEventLogger::FormEventLogger(bool is_for_credit_card)
: is_for_credit_card_(is_for_credit_card),
is_server_data_available_(false),
diff --git a/components/autofill/core/browser/autofill_metrics.h b/components/autofill/core/browser/autofill_metrics.h
index 613d58d..3d67990 100644
--- a/components/autofill/core/browser/autofill_metrics.h
+++ b/components/autofill/core/browser/autofill_metrics.h
@@ -418,6 +418,14 @@ class AutofillMetrics {
NUM_WALLET_REQUIRED_ACTIONS
};
+ // For measuring the increased load on the Autofill server if the restriction
+ // on querying for password forms with fewer than 3 fields were omitted.
+ enum PasswordFormQueryVolumeMetric {
+ NEW_PASSWORD_QUERY,
+ CURRENT_QUERY,
+ NUM_PASSWORD_FORM_QUERY_VOLUME_METRIC,
+ };
+
static void LogCreditCardInfoBarMetric(InfoBarMetric metric);
static void LogScanCreditCardPromptMetric(ScanCreditCardPromptMetric metric);
@@ -551,6 +559,10 @@ class AutofillMetrics {
// form.
static void LogAddressSuggestionsCount(size_t num_suggestions);
+ // Log password form query: current and if one-to-two fields password forms
+ // were allowed.
+ static void LogPasswordFormQueryVolume(PasswordFormQueryVolumeMetric metric);
+
// Utility to autofill form events in the relevant histograms depending on
// the presence of server and/or local data.
class FormEventLogger {
diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h
index 732b607..8e2e7a1 100644
--- a/components/autofill/core/browser/form_structure.h
+++ b/components/autofill/core/browser/form_structure.h
@@ -179,6 +179,8 @@ class FormStructure {
const GURL& source_url() const { return source_url_; }
+ bool has_password_field() const { return has_password_field_; }
+
void set_upload_required(UploadRequired required) {
upload_required_ = required;
}