| 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 SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
| 6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 6 #define SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> |
| 10 #include <string> | 11 #include <string> |
| 11 | 12 |
| 12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
| 13 #include "base/macros.h" | 14 #include "base/macros.h" |
| 14 #include "base/memory/scoped_ptr.h" | |
| 15 #include "base/threading/non_thread_safe.h" | 15 #include "base/threading/non_thread_safe.h" |
| 16 #include "sql/connection.h" | 16 #include "sql/connection.h" |
| 17 #include "sql/statement.h" | 17 #include "sql/statement.h" |
| 18 #include "sync/base/sync_export.h" | 18 #include "sync/base/sync_export.h" |
| 19 #include "sync/internal_api/public/base/model_type.h" | 19 #include "sync/internal_api/public/base/model_type.h" |
| 20 #include "sync/syncable/dir_open_result.h" | 20 #include "sync/syncable/dir_open_result.h" |
| 21 #include "sync/syncable/directory.h" | 21 #include "sync/syncable/directory.h" |
| 22 #include "sync/syncable/metahandle_set.h" | 22 #include "sync/syncable/metahandle_set.h" |
| 23 | 23 |
| 24 namespace sync_pb { | 24 namespace sync_pb { |
| (...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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); |
| 248 | 248 |
| 249 const std::string dir_name_; | 249 const std::string dir_name_; |
| 250 const int database_page_size_; | 250 const int database_page_size_; |
| 251 | 251 |
| 252 scoped_ptr<sql::Connection> db_; | 252 std::unique_ptr<sql::Connection> db_; |
| 253 sql::Statement save_meta_statement_; | 253 sql::Statement save_meta_statement_; |
| 254 sql::Statement save_delete_journal_statement_; | 254 sql::Statement save_delete_journal_statement_; |
| 255 | 255 |
| 256 // Set to true if migration left some old columns around that need to be | 256 // Set to true if migration left some old columns around that need to be |
| 257 // discarded. | 257 // discarded. |
| 258 bool needs_metas_column_refresh_; | 258 bool needs_metas_column_refresh_; |
| 259 bool needs_share_info_column_refresh_; | 259 bool needs_share_info_column_refresh_; |
| 260 | 260 |
| 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 // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
| OLD | NEW |