OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 6 #define COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
11 #include <string> | 11 #include <string> |
12 | 12 |
13 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "components/sync/base/model_type.h" |
| 17 #include "components/sync/base/sync_export.h" |
| 18 #include "components/sync/syncable/dir_open_result.h" |
| 19 #include "components/sync/syncable/directory.h" |
| 20 #include "components/sync/syncable/metahandle_set.h" |
16 #include "sql/connection.h" | 21 #include "sql/connection.h" |
17 #include "sql/statement.h" | 22 #include "sql/statement.h" |
18 #include "sync/base/sync_export.h" | |
19 #include "sync/internal_api/public/base/model_type.h" | |
20 #include "sync/syncable/dir_open_result.h" | |
21 #include "sync/syncable/directory.h" | |
22 #include "sync/syncable/metahandle_set.h" | |
23 | 23 |
24 namespace sync_pb { | 24 namespace sync_pb { |
25 class EntitySpecifics; | 25 class EntitySpecifics; |
26 } | 26 } |
27 | 27 |
28 namespace syncer { | 28 namespace syncer { |
29 namespace syncable { | 29 namespace syncable { |
30 | 30 |
31 SYNC_EXPORT extern const int32_t kCurrentDBVersion; | 31 SYNC_EXPORT extern const int32_t kCurrentDBVersion; |
32 SYNC_EXPORT extern const int32_t kCurrentPageSizeKB; | 32 SYNC_EXPORT extern const int32_t kCurrentPageSizeKB; |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 // false on error. | 222 // false on error. |
223 bool CreateMetasTable(bool is_temporary); | 223 bool CreateMetasTable(bool is_temporary); |
224 | 224 |
225 // Returns true on success, false on error. | 225 // Returns true on success, false on error. |
226 bool CreateModelsTable(); | 226 bool CreateModelsTable(); |
227 bool CreateV71ModelsTable(); | 227 bool CreateV71ModelsTable(); |
228 bool CreateV75ModelsTable(); | 228 bool CreateV75ModelsTable(); |
229 bool CreateV81ModelsTable(); | 229 bool CreateV81ModelsTable(); |
230 | 230 |
231 // Returns true on success, false on error. | 231 // Returns true on success, false on error. |
232 bool MigrateToSpecifics(const char* old_columns, | 232 bool MigrateToSpecifics( |
233 const char* specifics_column, | 233 const char* old_columns, |
234 void(*handler_function) ( | 234 const char* specifics_column, |
235 sql::Statement* old_value_query, | 235 void (*handler_function)(sql::Statement* old_value_query, |
236 int old_value_column, | 236 int old_value_column, |
237 sync_pb::EntitySpecifics* mutable_new_value)); | 237 sync_pb::EntitySpecifics* mutable_new_value)); |
238 | 238 |
239 // Returns true on success, false on error. | 239 // Returns true on success, false on error. |
240 bool Vacuum(); | 240 bool Vacuum(); |
241 | 241 |
242 // Returns true on success, false on error. | 242 // Returns true on success, false on error. |
243 bool UpdatePageSizeIfNecessary(); | 243 bool UpdatePageSizeIfNecessary(); |
244 | 244 |
245 // Prepares |save_statement| for saving entries in |table|. | 245 // Prepares |save_statement| for saving entries in |table|. |
246 void PrepareSaveEntryStatement(EntryTable table, | 246 void PrepareSaveEntryStatement(EntryTable table, |
247 sql::Statement* save_statement); | 247 sql::Statement* save_statement); |
(...skipping 13 matching lines...) Expand all Loading... |
261 // We keep a copy of the Closure so we reinstall it when the underlying | 261 // We keep a copy of the Closure so we reinstall it when the underlying |
262 // sql::Connection is destroyed/recreated. | 262 // sql::Connection is destroyed/recreated. |
263 base::Closure catastrophic_error_handler_; | 263 base::Closure catastrophic_error_handler_; |
264 | 264 |
265 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 265 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
266 }; | 266 }; |
267 | 267 |
268 } // namespace syncable | 268 } // namespace syncable |
269 } // namespace syncer | 269 } // namespace syncer |
270 | 270 |
271 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 271 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
OLD | NEW |