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