Index: components/autofill/core/common/form_field_data.cc |
diff --git a/components/autofill/core/common/form_field_data.cc b/components/autofill/core/common/form_field_data.cc |
index cda33d07521ee416e312360645f68048023214df..b862abd723bfbbcfcd1bffcb86be54b48d1d8a6e 100644 |
--- a/components/autofill/core/common/form_field_data.cc |
+++ b/components/autofill/core/common/form_field_data.cc |
@@ -70,6 +70,7 @@ bool FormFieldData::SameFieldAs(const FormFieldData& field) const { |
name == field.name && |
form_control_type == field.form_control_type && |
autocomplete_attribute == field.autocomplete_attribute && |
+ role == field.role && |
max_length == field.max_length && |
// is_checked and is_autofilled counts as "value" since these change |
// when we fill things in. |
@@ -96,6 +97,8 @@ bool FormFieldData::operator<(const FormFieldData& field) const { |
if (form_control_type > field.form_control_type) return false; |
if (autocomplete_attribute < field.autocomplete_attribute) return true; |
if (autocomplete_attribute > field.autocomplete_attribute) return false; |
+ if (role < field.role) return true; |
+ if (role > field.role) return false; |
if (max_length < field.max_length) return true; |
if (max_length > field.max_length) return false; |
// Skip is_checked and is_autofilled as in SameFieldAs. |
@@ -119,6 +122,7 @@ void SerializeFormFieldData(const FormFieldData& field_data, |
pickle->WriteString16(field_data.value); |
pickle->WriteString(field_data.form_control_type); |
pickle->WriteString(field_data.autocomplete_attribute); |
+ pickle->WriteString(field_data.role); |
pickle->WriteSizeT(field_data.max_length); |
pickle->WriteBool(field_data.is_autofilled); |
pickle->WriteBool(field_data.is_checked); |
@@ -145,6 +149,7 @@ bool DeserializeFormFieldData(PickleIterator* iter, |
!iter->ReadString16(&field_data->value) || |
!iter->ReadString(&field_data->form_control_type) || |
!iter->ReadString(&field_data->autocomplete_attribute) || |
+ !iter->ReadString(&field_data->role) || |
!iter->ReadSizeT(&field_data->max_length) || |
!iter->ReadBool(&field_data->is_autofilled) || |
!iter->ReadBool(&field_data->is_checked) || |
@@ -179,6 +184,8 @@ std::ostream& operator<<(std::ostream& os, const FormFieldData& field) { |
<< " " |
<< field.autocomplete_attribute |
<< " " |
+ << field.role |
+ << " " |
<< field.max_length |
<< " " |
<< (field.is_autofilled ? "true" : "false") |