Commit 457bd390 authored by Maxim Kolosovskiy's avatar Maxim Kolosovskiy Committed by Commit Bot

[Password Manager] Remove DCHECKs for field name as a field can have

empty name

Votes are not uploaded for fields with empty names. It is checked in |LabelFields|. So, adding empty keys to |field_types| is ok.

Bug: 850013
Change-Id: I46dd0b665a612d5c23e116d7e2664e5c12d7f804
Reviewed-on: https://chromium-review.googlesource.com/1092855
Commit-Queue: Maxim Kolosovskiy <kolos@chromium.org>
Reviewed-by: default avatarVadym Doroshenko <dvadym@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566011}
parent d5dcc18a
...@@ -136,7 +136,8 @@ void SetFieldLabelsOnUpdate(const autofill::ServerFieldType password_type, ...@@ -136,7 +136,8 @@ void SetFieldLabelsOnUpdate(const autofill::ServerFieldType password_type,
password_type == autofill::PROBABLY_NEW_PASSWORD || password_type == autofill::PROBABLY_NEW_PASSWORD ||
password_type == autofill::NOT_NEW_PASSWORD) password_type == autofill::NOT_NEW_PASSWORD)
<< password_type; << password_type;
DCHECK(!submitted_form.new_password_element.empty()); if (submitted_form.new_password_element.empty())
return;
(*field_types)[submitted_form.password_element] = autofill::PASSWORD; (*field_types)[submitted_form.password_element] = autofill::PASSWORD;
(*field_types)[submitted_form.new_password_element] = password_type; (*field_types)[submitted_form.new_password_element] = password_type;
...@@ -154,8 +155,7 @@ void SetFieldLabelsOnSave(const autofill::ServerFieldType password_type, ...@@ -154,8 +155,7 @@ void SetFieldLabelsOnSave(const autofill::ServerFieldType password_type,
if (!form.new_password_element.empty()) { if (!form.new_password_element.empty()) {
(*field_types)[form.new_password_element] = password_type; (*field_types)[form.new_password_element] = password_type;
} else { } else if (!form.password_element.empty()) {
DCHECK(!form.password_element.empty());
(*field_types)[form.password_element] = password_type; (*field_types)[form.password_element] = password_type;
} }
} }
......
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