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

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

Issue 2609703002: Remove ScopedVector from autofill. (Closed)
Patch Set: ios 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/form_structure.h
diff --git a/components/autofill/core/browser/form_structure.h b/components/autofill/core/browser/form_structure.h
index 54288a716b5d73b8181757893c6cc3496facbb02..258eebc8c9b5d10596b10ff671c52199e6be01c8 100644
--- a/components/autofill/core/browser/form_structure.h
+++ b/components/autofill/core/browser/form_structure.h
@@ -7,6 +7,7 @@
#include <stddef.h>
+#include <memory>
#include <set>
#include <string>
#include <vector>
@@ -14,7 +15,6 @@
#include "base/callback.h"
#include "base/gtest_prod_util.h"
#include "base/macros.h"
-#include "base/memory/scoped_vector.h"
#include "base/strings/string16.h"
#include "base/strings/string_piece.h"
#include "components/autofill/core/browser/autofill_field.h"
@@ -46,6 +46,8 @@ struct FormDataPredictions;
// in the fields along with additional information needed by Autofill.
class FormStructure {
public:
+ using FieldsVector = std::vector<std::unique_ptr<AutofillField>>;
vabr (Chromium) 2017/01/02 08:30:21 nit: I'm not completely sure if this alias is help
Avi (use Gerrit) 2017/01/02 20:32:03 Done.
+
explicit FormStructure(const FormData& form);
virtual ~FormStructure();
@@ -188,12 +190,8 @@ class FormStructure {
size_t autofill_count() const { return autofill_count_; }
// Used for iterating over the fields.
- std::vector<AutofillField*>::const_iterator begin() const {
- return fields_.begin();
- }
- std::vector<AutofillField*>::const_iterator end() const {
- return fields_.end();
- }
+ FieldsVector::const_iterator begin() const { return fields_.begin(); }
+ FieldsVector::const_iterator end() const { return fields_.end(); }
const base::string16& form_name() const { return form_name_; }
@@ -274,7 +272,7 @@ class FormStructure {
size_t autofill_count_;
// A vector of all the input fields in the form.
- ScopedVector<AutofillField> fields_;
+ FieldsVector fields_;
// The number of fields that are part of the form signature and that are
// included in queries to the Autofill server.
« no previous file with comments | « components/autofill/core/browser/form_field_unittest.cc ('k') | components/autofill/core/browser/form_structure.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698