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

Unified Diff: components/autofill/core/browser/autofill_scanner.h

Issue 2609703002: Remove ScopedVector from autofill. (Closed)
Patch Set: drop the using Created 3 years, 12 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
Index: components/autofill/core/browser/autofill_scanner.h
diff --git a/components/autofill/core/browser/autofill_scanner.h b/components/autofill/core/browser/autofill_scanner.h
index f30d5abcbc37ccd4fb9101f60a52b36bf124bf28..88b84e6fd943808df1c17d36fdf6f7f9cb100101 100644
--- a/components/autofill/core/browser/autofill_scanner.h
+++ b/components/autofill/core/browser/autofill_scanner.h
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <memory>
#include <vector>
#include "base/macros.h"
@@ -20,6 +21,8 @@ class AutofillField;
class AutofillScanner {
public:
explicit AutofillScanner(const std::vector<AutofillField*>& fields);
+ explicit AutofillScanner(
+ const std::vector<std::unique_ptr<AutofillField>>& fields);
~AutofillScanner();
// Advances the cursor by one step, if possible.
@@ -43,6 +46,8 @@ class AutofillScanner {
size_t SaveCursor();
private:
+ void Init(const std::vector<AutofillField*>& fields);
+
// Indicates the current position in the stream, represented as a vector.
std::vector<AutofillField*>::const_iterator cursor_;
@@ -50,10 +55,13 @@ class AutofillScanner {
std::vector<AutofillField*>::const_iterator saved_cursor_;
// The beginning pointer for the stream.
- const std::vector<AutofillField*>::const_iterator begin_;
+ std::vector<AutofillField*>::const_iterator begin_;
// The past-the-end pointer for the stream.
- const std::vector<AutofillField*>::const_iterator end_;
+ std::vector<AutofillField*>::const_iterator end_;
+
+ // The storage of non-owning pointers, used for the unique_ptr constructor.
+ std::vector<AutofillField*> non_owning_;
DISALLOW_COPY_AND_ASSIGN(AutofillScanner);
};
« no previous file with comments | « components/autofill/core/browser/autofill_profile_unittest.cc ('k') | components/autofill/core/browser/autofill_scanner.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698