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 |
11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
12 #include "base/gtest_prod_util.h" | 12 #include "base/gtest_prod_util.h" |
13 #include "chrome/browser/sync/syncable/dir_open_result.h" | 13 #include "chrome/browser/sync/syncable/dir_open_result.h" |
14 #include "chrome/browser/sync/syncable/model_type.h" | 14 #include "chrome/browser/sync/syncable/model_type.h" |
15 #include "chrome/browser/sync/syncable/syncable.h" | 15 #include "chrome/browser/sync/syncable/syncable.h" |
16 | 16 |
17 extern "C" { | 17 extern "C" { |
18 struct sqlite3; | 18 struct sqlite3; |
19 struct sqlite3_stmt; | |
20 } | 19 } |
21 | 20 |
| 21 namespace sqlite_utils { |
22 class SQLStatement; | 22 class SQLStatement; |
| 23 } |
23 | 24 |
24 namespace sync_pb { | 25 namespace sync_pb { |
25 class EntitySpecifics; | 26 class EntitySpecifics; |
26 } | 27 } |
27 | 28 |
28 namespace syncable { | 29 namespace syncable { |
29 | 30 |
30 struct ColumnSpec; | 31 struct ColumnSpec; |
31 typedef Directory::MetahandlesIndex MetahandlesIndex; | 32 typedef Directory::MetahandlesIndex MetahandlesIndex; |
32 | 33 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 bool CheckIntegrity(sqlite3* handle, std::string* error) const; | 160 bool CheckIntegrity(sqlite3* handle, std::string* error) const; |
160 | 161 |
161 // Migration utilities. | 162 // Migration utilities. |
162 bool AddColumn(const ColumnSpec* column); | 163 bool AddColumn(const ColumnSpec* column); |
163 bool RefreshColumns(); | 164 bool RefreshColumns(); |
164 bool SetVersion(int version); | 165 bool SetVersion(int version); |
165 int GetVersion(); | 166 int GetVersion(); |
166 bool MigrateToSpecifics(const char* old_columns, | 167 bool MigrateToSpecifics(const char* old_columns, |
167 const char* specifics_column, | 168 const char* specifics_column, |
168 void(*handler_function) ( | 169 void(*handler_function) ( |
169 SQLStatement* old_value_query, | 170 sqlite_utils::SQLStatement* old_value_query, |
170 int old_value_column, | 171 int old_value_column, |
171 sync_pb::EntitySpecifics* mutable_new_value)); | 172 sync_pb::EntitySpecifics* mutable_new_value)); |
172 | 173 |
173 // Individual version migrations. | 174 // Individual version migrations. |
174 bool MigrateVersion67To68(); | 175 bool MigrateVersion67To68(); |
175 bool MigrateVersion68To69(); | 176 bool MigrateVersion68To69(); |
176 bool MigrateVersion69To70(); | 177 bool MigrateVersion69To70(); |
177 bool MigrateVersion70To71(); | 178 bool MigrateVersion70To71(); |
178 bool MigrateVersion71To72(); | 179 bool MigrateVersion71To72(); |
179 bool MigrateVersion72To73(); | 180 bool MigrateVersion72To73(); |
(...skipping 16 matching lines...) Expand all Loading... |
196 // 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 |
197 // discarded. | 198 // discarded. |
198 bool needs_column_refresh_; | 199 bool needs_column_refresh_; |
199 | 200 |
200 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 201 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
201 }; | 202 }; |
202 | 203 |
203 } // namespace syncable | 204 } // namespace syncable |
204 | 205 |
205 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 206 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
OLD | NEW |