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

Unified Diff: chrome/browser/autofill/credit_card_field.cc

Issue 7120005: Simplify Autofill Scanner semantics (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 6 months 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
« no previous file with comments | « chrome/browser/autofill/autofill_scanner.cc ('k') | chrome/browser/autofill/phone_field.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/credit_card_field.cc
diff --git a/chrome/browser/autofill/credit_card_field.cc b/chrome/browser/autofill/credit_card_field.cc
index 13f5a89eaa94eb29d6984f128a61cc1026ad5e18..8d504f4bf667f52ddc7c0492ef6f48519ef6ca32 100644
--- a/chrome/browser/autofill/credit_card_field.cc
+++ b/chrome/browser/autofill/credit_card_field.cc
@@ -27,7 +27,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner,
return NULL;
scoped_ptr<CreditCardField> credit_card_field(new CreditCardField);
- scanner->SaveCursor();
+ size_t saved_cursor = scanner->SaveCursor();
// Credit card fields can appear in many different orders.
// We loop until no more credit card related fields are found, see |break| at
@@ -131,7 +131,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner,
if (!ParseFieldSpecifics(scanner, pattern, MATCH_DEFAULT | MATCH_SELECT,
&credit_card_field->expiration_year_)) {
- scanner->Rewind();
+ scanner->RewindTo(saved_cursor);
return NULL;
}
continue;
@@ -179,7 +179,7 @@ FormField* CreditCardField::Parse(AutofillScanner* scanner,
return credit_card_field.release();
}
- scanner->Rewind();
+ scanner->RewindTo(saved_cursor);
return NULL;
}
« no previous file with comments | « chrome/browser/autofill/autofill_scanner.cc ('k') | chrome/browser/autofill/phone_field.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698