auto field1Value = optional_field1.value().value();Stanislav MikheyevPlease don't use `auto` - it's not obvious to infer the type from the RHS.
Same comment below.
Also, consider using `optional_field1->value()`.
Done
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
4 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:
```
The name of the file: components/autofill/core/browser/webdata/autocomplete/autocomplete_table_label_sensitive.h
Insertions: 8, Deletions: 3.
@@ -17,6 +17,7 @@
#include <type_traits>
#include <vector>
+#include "base/compiler_specific.h"
#include "base/time/time.h"
#include "components/autofill/core/browser/webdata/autocomplete/autocomplete_entry_label_sensitive.h"
#include "components/autofill/core/common/form_field_data.h"
@@ -66,10 +67,14 @@
AutocompleteSearchResultLabelSensitive&& other);
// Getters
- const std::u16string& value() const { return value_; }
+ const std::u16string& value() const LIFETIME_BOUND { return value_; }
MatchingType matching_type() const { return matching_type_; }
- const std::u16string& query_name() const { return query_name_; }
- const std::u16string& query_label() const { return query_label_; }
+ const std::u16string& query_name() const LIFETIME_BOUND {
+ return query_name_;
+ }
+ const std::u16string& query_label() const LIFETIME_BOUND {
+ return query_label_;
+ }
int count() const { return count_; }
bool operator==(const AutocompleteSearchResultLabelSensitive& other) const {
```
```
The name of the file: components/autofill/core/browser/webdata/autocomplete/autocomplete_table_label_sensitive_unittest.cc
Insertions: 10, Deletions: 15.
@@ -541,22 +541,17 @@
kDefaultName, kDefaultLabel, /*prefix=*/u"clark k", /*limit=*/10,
entries_narrowed_down));
- auto field1Value = optional_field1.value().value();
- auto field2Value = optional_field2.value().value();
-
- auto field1Name = optional_field1.value().name();
- auto field2Name = optional_field2.value().name();
-
- auto field1Label = optional_field1.value().label();
- auto field2Label = optional_field2.value().label();
-
- EXPECT_THAT(entries,
- UnorderedElementsAre(
- EqualsSearchResult(field1Value, field1Name, field1Label, 1),
- EqualsSearchResult(field2Value, field2Name, field2Label, 1)));
EXPECT_THAT(
- entries_narrowed_down,
- ElementsAre(EqualsSearchResult(field1Value, field1Name, field1Label, 1)));
+ entries,
+ UnorderedElementsAre(
+ EqualsSearchResult(optional_field1->value(), optional_field1->name(),
+ optional_field1->label(), 1),
+ EqualsSearchResult(optional_field2->value(), optional_field2->name(),
+ optional_field2->label(), 1)));
+ EXPECT_THAT(entries_narrowed_down,
+ ElementsAre(EqualsSearchResult(optional_field1->value(),
+ optional_field1->name(),
+ optional_field1->label(), 1)));
}
// GetFormValuesForElementNameAndLabel normalizes the label before querying the
```
Autofill: Add name and label fields to autocomplete search result
These fields will be needed to call OnRemoveCurrentSingleFieldSuggestion
in AutofillExternalDelegate::RemoveSuggestion.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |