Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 5 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 22 | 22 |
| 23 namespace base { | 23 namespace base { |
| 24 class Time; | 24 class Time; |
| 25 } | 25 } |
| 26 | 26 |
| 27 namespace autofill { | 27 namespace autofill { |
| 28 | 28 |
| 29 class AutofillChange; | 29 class AutofillChange; |
| 30 class AutofillEntry; | 30 class AutofillEntry; |
| 31 class AutofillProfile; | 31 class AutofillProfile; |
| 32 class AutofillTableEncryptor; | |
| 32 class AutofillTableTest; | 33 class AutofillTableTest; |
| 33 class CreditCard; | 34 class CreditCard; |
| 34 | 35 |
| 35 struct FormFieldData; | 36 struct FormFieldData; |
| 36 | 37 |
| 37 // This class manages the various Autofill tables within the SQLite database | 38 // This class manages the various Autofill tables within the SQLite database |
| 38 // passed to the constructor. It expects the following schemas: | 39 // passed to the constructor. It expects the following schemas: |
| 39 // | 40 // |
| 40 // Note: The database stores time in seconds, UTC. | 41 // Note: The database stores time in seconds, UTC. |
| 41 // | 42 // |
| (...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 244 // | 245 // |
| 245 // autofill_model_type_state | 246 // autofill_model_type_state |
| 246 // Single row table that contains the sync ModelTypeState | 247 // Single row table that contains the sync ModelTypeState |
| 247 // for the autofill model type. | 248 // for the autofill model type. |
| 248 // | 249 // |
| 249 // value The serialized ModelTypeState record. | 250 // value The serialized ModelTypeState record. |
| 250 | 251 |
| 251 class AutofillTable : public WebDatabaseTable { | 252 class AutofillTable : public WebDatabaseTable { |
| 252 public: | 253 public: |
| 253 AutofillTable(); | 254 AutofillTable(); |
| 255 explicit AutofillTable( | |
| 256 std::unique_ptr<AutofillTableEncryptor> autofill_table_encryptor); | |
|
Roger McFarlane (Chromium)
2017/02/22 22:50:52
This additional public constructor seems redundant
devarajn
2017/02/22 23:10:54
We can use this constructor to inject mocks in uni
Roger McFarlane (Chromium)
2017/02/22 23:20:34
The factory can also be used to inject mocks into
devarajn
2017/02/22 23:26:05
Alright. I will remove this constructor.
| |
| 254 ~AutofillTable() override; | 257 ~AutofillTable() override; |
| 255 | 258 |
| 256 // Retrieves the AutofillTable* owned by |db|. | 259 // Retrieves the AutofillTable* owned by |db|. |
| 257 static AutofillTable* FromWebDatabase(WebDatabase* db); | 260 static AutofillTable* FromWebDatabase(WebDatabase* db); |
| 258 | 261 |
| 259 // WebDatabaseTable: | 262 // WebDatabaseTable: |
| 260 WebDatabaseTable::TypeKey GetTypeKey() const override; | 263 WebDatabaseTable::TypeKey GetTypeKey() const override; |
| 261 bool CreateTablesIfNecessary() override; | 264 bool CreateTablesIfNecessary() override; |
| 262 bool IsSyncable() override; | 265 bool IsSyncable() override; |
| 263 bool MigrateToVersion(int version, bool* update_compatible_version) override; | 266 bool MigrateToVersion(int version, bool* update_compatible_version) override; |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 460 bool MigrateToVersion67AddMaskedCardBillingAddress(); | 463 bool MigrateToVersion67AddMaskedCardBillingAddress(); |
| 461 bool MigrateToVersion70AddSyncMetadata(); | 464 bool MigrateToVersion70AddSyncMetadata(); |
| 462 bool MigrateToVersion71AddHasConvertedAndBillingAddressIdMetadata(); | 465 bool MigrateToVersion71AddHasConvertedAndBillingAddressIdMetadata(); |
| 463 | 466 |
| 464 // Max data length saved in the table, AKA the maximum length allowed for | 467 // Max data length saved in the table, AKA the maximum length allowed for |
| 465 // form data. | 468 // form data. |
| 466 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. | 469 // Copied to components/autofill/ios/browser/resources/autofill_controller.js. |
| 467 static const size_t kMaxDataLength; | 470 static const size_t kMaxDataLength; |
| 468 | 471 |
| 469 private: | 472 private: |
| 473 std::unique_ptr<AutofillTableEncryptor> autofill_table_encryptor_; | |
|
please use gerrit instead
2017/02/22 22:34:58
Please move the variable below all methods. (Line
devarajn
2017/02/22 23:10:54
Acknowledged.
| |
| 474 | |
| 470 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); | 475 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill); |
| 471 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); | 476 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_AddChanges); |
| 472 FRIEND_TEST_ALL_PREFIXES( | 477 FRIEND_TEST_ALL_PREFIXES( |
| 473 AutofillTableTest, | 478 AutofillTableTest, |
| 474 Autofill_GetCountOfValuesContainedBetween); | 479 Autofill_GetCountOfValuesContainedBetween); |
| 475 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); | 480 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_RemoveBetweenChanges); |
| 476 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); | 481 FRIEND_TEST_ALL_PREFIXES(AutofillTableTest, Autofill_UpdateDontReplace); |
| 477 FRIEND_TEST_ALL_PREFIXES( | 482 FRIEND_TEST_ALL_PREFIXES( |
| 478 AutofillTableTest, | 483 AutofillTableTest, |
| 479 Autofill_RemoveFormElementsAddedBetween_UsedOnlyBefore); | 484 Autofill_RemoveFormElementsAddedBetween_UsedOnlyBefore); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 545 bool InitServerAddressMetadataTable(); | 550 bool InitServerAddressMetadataTable(); |
| 546 bool InitAutofillSyncMetadataTable(); | 551 bool InitAutofillSyncMetadataTable(); |
| 547 bool InitModelTypeStateTable(); | 552 bool InitModelTypeStateTable(); |
| 548 | 553 |
| 549 DISALLOW_COPY_AND_ASSIGN(AutofillTable); | 554 DISALLOW_COPY_AND_ASSIGN(AutofillTable); |
| 550 }; | 555 }; |
| 551 | 556 |
| 552 } // namespace autofill | 557 } // namespace autofill |
| 553 | 558 |
| 554 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ | 559 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_WEBDATA_AUTOFILL_TABLE_H_ |
| OLD | NEW |