Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(312)

Unified Diff: components/autofill/core/browser/form_field.cc

Issue 1453193002: autofill: switch autofill_regexes to RE2 library (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 14 tests failing Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/autofill/core/browser/form_field.cc
diff --git a/components/autofill/core/browser/form_field.cc b/components/autofill/core/browser/form_field.cc
index 50d7e8a30a81cf74343e3656627695840085f9cf..75c3ccde9f0b8c7005a76a50b400dacf7753d976 100644
--- a/components/autofill/core/browser/form_field.cc
+++ b/components/autofill/core/browser/form_field.cc
@@ -84,14 +84,14 @@ void FormField::ParseFormFields(const std::vector<AutofillField*>& fields,
// static
bool FormField::ParseField(AutofillScanner* scanner,
- const base::string16& pattern,
+ const std::string& pattern,
AutofillField** match) {
return ParseFieldSpecifics(scanner, pattern, MATCH_DEFAULT, match);
}
// static
bool FormField::ParseFieldSpecifics(AutofillScanner* scanner,
- const base::string16& pattern,
+ const std::string& pattern,
int match_type,
AutofillField** match) {
if (scanner->IsEnd())
@@ -108,7 +108,7 @@ bool FormField::ParseFieldSpecifics(AutofillScanner* scanner,
// static
FormField::ParseNameLabelResult FormField::ParseNameAndLabelSeparately(
AutofillScanner* scanner,
- const base::string16& pattern,
+ const std::string& pattern,
int match_type,
AutofillField** match) {
if (scanner->IsEnd())
@@ -143,7 +143,7 @@ FormField::ParseNameLabelResult FormField::ParseNameAndLabelSeparately(
bool FormField::ParseEmptyLabel(AutofillScanner* scanner,
AutofillField** match) {
return ParseFieldSpecifics(scanner,
- base::ASCIIToUTF16("^$"),
+ "^$",
MATCH_LABEL | MATCH_ALL_INPUTS,
match);
}
@@ -161,7 +161,7 @@ bool FormField::AddClassification(const AutofillField* field,
// static.
bool FormField::MatchAndAdvance(AutofillScanner* scanner,
- const base::string16& pattern,
+ const std::string& pattern,
int match_type,
AutofillField** match) {
AutofillField* field = scanner->Cursor();
@@ -177,7 +177,7 @@ bool FormField::MatchAndAdvance(AutofillScanner* scanner,
// static
bool FormField::Match(const AutofillField* field,
- const base::string16& pattern,
+ const std::string& pattern,
int match_type) {
if ((match_type & FormField::MATCH_LABEL) &&
MatchesPattern(field->label, pattern)) {

Powered by Google App Engine
This is Rietveld 408576698