| 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 COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 5 #ifndef COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
| 6 #define COMPONENTS_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" | 16 #include "components/sync/base/model_type.h" |
| 17 #include "components/sync/syncable/dir_open_result.h" | 17 #include "components/sync/syncable/dir_open_result.h" |
| 18 #include "components/sync/syncable/directory.h" | 18 #include "components/sync/syncable/directory.h" |
| 19 #include "components/sync/syncable/metahandle_set.h" | 19 #include "components/sync/syncable/metahandle_set.h" |
| 20 #include "sql/connection.h" | 20 #include "sql/connection.h" |
| 21 #include "sql/statement.h" | 21 #include "sql/statement.h" |
| 22 | 22 |
| 23 namespace base { |
| 24 namespace trace_event { |
| 25 class MemoryAllocatorDump; |
| 26 } |
| 27 } |
| 28 |
| 23 namespace sync_pb { | 29 namespace sync_pb { |
| 24 class EntitySpecifics; | 30 class EntitySpecifics; |
| 25 } | 31 } |
| 26 | 32 |
| 27 namespace syncer { | 33 namespace syncer { |
| 28 namespace syncable { | 34 namespace syncable { |
| 29 | 35 |
| 30 extern const int32_t kCurrentDBVersion; | 36 extern const int32_t kCurrentDBVersion; |
| 31 extern const int32_t kCurrentPageSizeKB; | 37 extern const int32_t kCurrentPageSizeKB; |
| 32 | 38 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 // | 99 // |
| 94 // There can be at most one handler. If this method is invoked when there is | 100 // There can be at most one handler. If this method is invoked when there is |
| 95 // already a handler, the existing handler is overwritten with | 101 // already a handler, the existing handler is overwritten with |
| 96 // |catastrophic_error_handler|. | 102 // |catastrophic_error_handler|. |
| 97 virtual void SetCatastrophicErrorHandler( | 103 virtual void SetCatastrophicErrorHandler( |
| 98 const base::Closure& catastrophic_error_handler); | 104 const base::Closure& catastrophic_error_handler); |
| 99 | 105 |
| 100 // Returns true on success, false on error. | 106 // Returns true on success, false on error. |
| 101 bool GetDatabasePageSize(int* page_size); | 107 bool GetDatabasePageSize(int* page_size); |
| 102 | 108 |
| 109 bool ReportMemoryUsage(base::trace_event::MemoryAllocatorDump* mad); |
| 110 |
| 103 protected: | 111 protected: |
| 104 // For test classes. | 112 // For test classes. |
| 105 DirectoryBackingStore(const std::string& dir_name, | 113 DirectoryBackingStore(const std::string& dir_name, |
| 106 sql::Connection* connection); | 114 sql::Connection* connection); |
| 107 | 115 |
| 108 // An accessor for the underlying sql::Connection. Avoid using outside of | 116 // An accessor for the underlying sql::Connection. Avoid using outside of |
| 109 // tests. | 117 // tests. |
| 110 sql::Connection* db(); | 118 sql::Connection* db(); |
| 111 | 119 |
| 112 // Return true if the DB is open. | 120 // Return true if the DB is open. |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 // sql::Connection is destroyed/recreated. | 269 // sql::Connection is destroyed/recreated. |
| 262 base::Closure catastrophic_error_handler_; | 270 base::Closure catastrophic_error_handler_; |
| 263 | 271 |
| 264 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 272 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
| 265 }; | 273 }; |
| 266 | 274 |
| 267 } // namespace syncable | 275 } // namespace syncable |
| 268 } // namespace syncer | 276 } // namespace syncer |
| 269 | 277 |
| 270 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 278 #endif // COMPONENTS_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
| OLD | NEW |