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

Unified Diff: chrome/browser/sync/syncable/directory_backing_store.cc

Issue 8770032: [Sync] Implement encryption-aware conflict resolution. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test Created 9 years 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: chrome/browser/sync/syncable/directory_backing_store.cc
diff --git a/chrome/browser/sync/syncable/directory_backing_store.cc b/chrome/browser/sync/syncable/directory_backing_store.cc
index 1f5294dfbc2097dcf78687beecd4ddfedefa9cd9..ac36232bfbe4ab82e121fc6d0fff99188fc26892 100644
--- a/chrome/browser/sync/syncable/directory_backing_store.cc
+++ b/chrome/browser/sync/syncable/directory_backing_store.cc
@@ -42,7 +42,7 @@ static const string::size_type kUpdateStatementBufferSize = 2048;
// Increment this version whenever updating DB tables.
extern const int32 kCurrentDBVersion; // Global visibility for our unittest.
-const int32 kCurrentDBVersion = 77;
+const int32 kCurrentDBVersion = 78;
namespace {
@@ -476,6 +476,12 @@ DirOpenResult DirectoryBackingStore::InitializeTables() {
version_on_disk = 77;
}
+ // Version 78 added the column base_server_specifics to the metas table.
+ if (version_on_disk == 77) {
+ if (MigrateVersion77To78())
+ version_on_disk = 78;
+ }
+
// If one of the migrations requested it, drop columns that aren't current.
// It's only safe to do this after migrating all the way to the current
// version.
@@ -1118,6 +1124,17 @@ bool DirectoryBackingStore::MigrateVersion76To77() {
return true;
}
+bool DirectoryBackingStore::MigrateVersion77To78() {
+ // Version 78 added one column to table 'metas': base_server_specifics.
+ int result =
+ ExecQuery(load_dbhandle_,
+ "ALTER TABLE metas ADD COLUMN base_server_specifics BLOB");
+ if (result != SQLITE_DONE)
+ return false;
+ SetVersion(78);
+ return true;
+}
+
int DirectoryBackingStore::CreateTables() {
DVLOG(1) << "First run, creating tables";
// Create two little tables share_version and share_info

Powered by Google App Engine
This is Rietveld 408576698