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

Unified Diff: chrome/browser/autofill/autofill_scanner.h

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 | « no previous file | chrome/browser/autofill/autofill_scanner.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autofill/autofill_scanner.h
diff --git a/chrome/browser/autofill/autofill_scanner.h b/chrome/browser/autofill/autofill_scanner.h
index 789889b2f615ed783af4265918c6c97be8958b0e..562bab84add342799358848582b4547d2c6535c9 100644
--- a/chrome/browser/autofill/autofill_scanner.h
+++ b/chrome/browser/autofill/autofill_scanner.h
@@ -29,19 +29,25 @@ class AutofillScanner {
// Returns |true| if the cursor has reached the end of the stream.
bool IsEnd() const;
- // Returns the most recently saved cursor -- see also |SaveCursor()|.
+ // Restores the most recently saved cursor. See also |SaveCursor()|.
void Rewind();
- // Saves the current cursor position. Multiple cursor positions can be saved,
- // with stack ordering semantics. See also |Rewind()|.
- void SaveCursor();
+ // Repositions the cursor to the specified |index|. See also |SaveCursor()|.
+ void RewindTo(size_t index);
+
+ // Saves and returns the current cursor position. See also |Rewind()| and
+ // |RewindTo()|.
+ size_t SaveCursor();
private:
// Indicates the current position in the stream, represented as a vector.
std::vector<const AutofillField*>::const_iterator cursor_;
- // A stack of saved positions in the stream.
- std::vector<std::vector<const AutofillField*>::const_iterator> saved_cursors_;
+ // The most recently saved cursor.
+ std::vector<const AutofillField*>::const_iterator saved_cursor_;
+
+ // The beginning pointer for the stream.
+ const std::vector<const AutofillField*>::const_iterator begin_;
// The past-the-end pointer for the stream.
const std::vector<const AutofillField*>::const_iterator end_;
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698