Commit 3a42148e authored by Maria Kazinova's avatar Maria Kazinova Committed by Commit Bot

Added a metric to check the number of extracted forms.

It is needed ro check the assumption that the data message received
and parsed on submission contains only one form at a time.

Change-Id: Ibb7af31e283bc67f40be1a46ad4bde4fb9763457
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2038572
Commit-Queue: Maria Kazinova <kazinova@google.com>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Reviewed-by: default avatarIlya Sherman <isherman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#738922}
parent 21d363e8
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include <stddef.h> #include <stddef.h>
#include "base/bind.h" #include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/sys_string_conversions.h" #include "base/strings/sys_string_conversions.h"
#include "base/values.h" #include "base/values.h"
#include "components/autofill/core/common/form_data.h" #include "components/autofill/core/common/form_data.h"
...@@ -179,6 +180,8 @@ constexpr char kCommandPrefix[] = "passwordForm"; ...@@ -179,6 +180,8 @@ constexpr char kCommandPrefix[] = "passwordForm";
NSString* nsFormData = [NSString stringWithUTF8String:formData.c_str()]; NSString* nsFormData = [NSString stringWithUTF8String:formData.c_str()];
autofill::ExtractFormsData(nsFormData, false, base::string16(), pageURL, autofill::ExtractFormsData(nsFormData, false, base::string16(), pageURL,
pageURL.GetOrigin(), &forms); pageURL.GetOrigin(), &forms);
UMA_HISTOGRAM_EXACT_LINEAR("PasswordManager.NumFormsExtractedIOS",
forms.size(), 50);
if (forms.size() != 1) if (forms.size() != 1)
return; return;
[self.delegate formHelper:self [self.delegate formHelper:self
......
...@@ -112128,6 +112128,17 @@ uploading your change for review. ...@@ -112128,6 +112128,17 @@ uploading your change for review.
</summary> </summary>
</histogram> </histogram>
<histogram name="PasswordManager.NumFormsExtractedIOS" units="forms"
expires_after="2020-06-01">
<owner>dvadym@chromium.org</owner>
<owner>kazinova@google.com</owner>
<summary>
Records the number of password forms extracted by PasswordFormHelper at the
moment of submission. This metric is needed to check the assumption that
received and parsed message contains only one form at a a time.
</summary>
</histogram>
<histogram name="PasswordManager.NumPasswordsDeletedByBulkDelete" units="units" <histogram name="PasswordManager.NumPasswordsDeletedByBulkDelete" units="units"
expires_after="M77"> expires_after="M77">
<obsolete> <obsolete>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment