OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
6 #define CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 6 #define CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 private: | 77 private: |
78 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion67To68); | 78 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion67To68); |
79 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion68To69); | 79 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion68To69); |
80 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion69To70); | 80 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion69To70); |
81 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion70To71); | 81 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion70To71); |
82 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion71To72); | 82 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion71To72); |
83 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion72To73); | 83 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion72To73); |
84 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion73To74); | 84 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion73To74); |
85 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion74To75); | 85 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion74To75); |
86 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion75To76); | 86 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion75To76); |
| 87 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, MigrateVersion76To77); |
87 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, ModelTypeIds); | 88 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, ModelTypeIds); |
88 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, Corruption); | 89 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, Corruption); |
89 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, DeleteEntries); | 90 FRIEND_TEST_ALL_PREFIXES(DirectoryBackingStoreTest, DeleteEntries); |
90 FRIEND_TEST_ALL_PREFIXES(MigrationTest, ToCurrentVersion); | 91 FRIEND_TEST_ALL_PREFIXES(MigrationTest, ToCurrentVersion); |
91 friend class MigrationTest; | 92 friend class MigrationTest; |
92 | 93 |
93 // General Directory initialization and load helpers. | 94 // General Directory initialization and load helpers. |
94 DirOpenResult InitializeTables(); | 95 DirOpenResult InitializeTables(); |
95 // Returns an sqlite return code, usually SQLITE_DONE. | 96 // Returns an sqlite return code, usually SQLITE_DONE. |
96 int CreateTables(); | 97 int CreateTables(); |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // Individual version migrations. | 175 // Individual version migrations. |
175 bool MigrateVersion67To68(); | 176 bool MigrateVersion67To68(); |
176 bool MigrateVersion68To69(); | 177 bool MigrateVersion68To69(); |
177 bool MigrateVersion69To70(); | 178 bool MigrateVersion69To70(); |
178 bool MigrateVersion70To71(); | 179 bool MigrateVersion70To71(); |
179 bool MigrateVersion71To72(); | 180 bool MigrateVersion71To72(); |
180 bool MigrateVersion72To73(); | 181 bool MigrateVersion72To73(); |
181 bool MigrateVersion73To74(); | 182 bool MigrateVersion73To74(); |
182 bool MigrateVersion74To75(); | 183 bool MigrateVersion74To75(); |
183 bool MigrateVersion75To76(); | 184 bool MigrateVersion75To76(); |
| 185 bool MigrateVersion76To77(); |
184 | 186 |
185 // The handle to our sqlite on-disk store for initialization and loading, and | 187 // The handle to our sqlite on-disk store for initialization and loading, and |
186 // for saving changes periodically via SaveChanges, respectively. | 188 // for saving changes periodically via SaveChanges, respectively. |
187 // TODO(timsteele): We should only have one handle here. The reason we need | 189 // TODO(timsteele): We should only have one handle here. The reason we need |
188 // two at the moment is because the DB can be opened by either the AuthWatcher | 190 // two at the moment is because the DB can be opened by either the AuthWatcher |
189 // or SyncCore threads, but SaveChanges is always called by the latter. We | 191 // or SyncCore threads, but SaveChanges is always called by the latter. We |
190 // need to change initialization so the DB is only accessed from one thread. | 192 // need to change initialization so the DB is only accessed from one thread. |
191 sqlite3* load_dbhandle_; | 193 sqlite3* load_dbhandle_; |
192 sqlite3* save_dbhandle_; | 194 sqlite3* save_dbhandle_; |
193 | 195 |
194 std::string dir_name_; | 196 std::string dir_name_; |
195 FilePath backing_filepath_; | 197 FilePath backing_filepath_; |
196 | 198 |
197 // Set to true if migration left some old columns around that need to be | 199 // Set to true if migration left some old columns around that need to be |
198 // discarded. | 200 // discarded. |
199 bool needs_column_refresh_; | 201 bool needs_column_refresh_; |
200 | 202 |
201 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 203 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
202 }; | 204 }; |
203 | 205 |
204 } // namespace syncable | 206 } // namespace syncable |
205 | 207 |
206 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 208 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
OLD | NEW |