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

Unified Diff: chrome/browser/webdata/autofill_table.cc

Issue 12518017: Generalize migration code in WebDatabase. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 9 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/webdata/autofill_table.h ('k') | chrome/browser/webdata/keyword_table.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/webdata/autofill_table.cc
diff --git a/chrome/browser/webdata/autofill_table.cc b/chrome/browser/webdata/autofill_table.cc
index 279ecfc6ad042be2675f1a51dc8fba40f30bb244..734c28ae8448bbed7732ce743e360e097e64c7c7 100644
--- a/chrome/browser/webdata/autofill_table.cc
+++ b/chrome/browser/webdata/autofill_table.cc
@@ -342,6 +342,52 @@ bool AutofillTable::IsSyncable() {
return true;
}
+bool AutofillTable::MigrateToVersion(int version,
+ const std::string& app_locale,
+ bool* update_compatible_version) {
+ // Migrate if necessary.
+ switch (version) {
+ case 22:
+ return ClearAutofillEmptyValueElements();
+ case 23:
+ return MigrateToVersion23AddCardNumberEncryptedColumn();
+ case 24:
+ return MigrateToVersion24CleanupOversizedStringFields();
+ case 27:
+ *update_compatible_version = true;
+ return MigrateToVersion27UpdateLegacyCreditCards();
+ case 30:
+ *update_compatible_version = true;
+ return MigrateToVersion30AddDateModifed();
+ case 31:
+ *update_compatible_version = true;
+ return MigrateToVersion31AddGUIDToCreditCardsAndProfiles();
+ case 32:
+ *update_compatible_version = true;
+ return MigrateToVersion32UpdateProfilesAndCreditCards();
+ case 33:
+ *update_compatible_version = true;
+ return MigrateToVersion33ProfilesBasedOnFirstName();
+ case 34:
+ *update_compatible_version = true;
+ return MigrateToVersion34ProfilesBasedOnCountryCode(app_locale);
+ case 35:
+ *update_compatible_version = true;
+ return MigrateToVersion35GreatBritainCountryCodes();
+ // Combine migrations 36 and 37. This is due to enhancements to the merge
+ // step when migrating profiles. The original migration from 35 to 36 did
+ // not merge profiles with identical addresses, but the migration from 36 to
+ // 37 does. The step from 35 to 36 should only happen on the Chrome 12 dev
+ // channel. Chrome 12 beta and release users will jump from 35 to 37
+ // directly getting the full benefits of the multi-valued merge as well as
+ // the culling of bad data.
+ case 37:
+ *update_compatible_version = true;
+ return MigrateToVersion37MergeAndCullOlderProfiles();
+ }
+ return true;
+}
+
bool AutofillTable::AddFormFieldValues(
const std::vector<FormFieldData>& elements,
std::vector<AutofillChange>* changes) {
« no previous file with comments | « chrome/browser/webdata/autofill_table.h ('k') | chrome/browser/webdata/keyword_table.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698