OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 sqlite3* LazyGetSaveHandle(); | 143 sqlite3* LazyGetSaveHandle(); |
144 | 144 |
145 // Drop all tables in preparation for reinitialization. | 145 // Drop all tables in preparation for reinitialization. |
146 void DropAllTables(); | 146 void DropAllTables(); |
147 | 147 |
148 // Serialization helpers for syncable::ModelType. These convert between | 148 // Serialization helpers for syncable::ModelType. These convert between |
149 // the ModelType enum and the values we persist in the database to identify | 149 // the ModelType enum and the values we persist in the database to identify |
150 // a model. We persist a default instance of the specifics protobuf as the | 150 // a model. We persist a default instance of the specifics protobuf as the |
151 // ID, rather than the enum value. | 151 // ID, rather than the enum value. |
152 static ModelType ModelIdToModelTypeEnum(const void* data, int length); | 152 static ModelType ModelIdToModelTypeEnum(const void* data, int length); |
153 static string ModelTypeEnumToModelId(ModelType model_type); | 153 static std::string ModelTypeEnumToModelId(ModelType model_type); |
154 | 154 |
155 // Runs an integrity check on the current database. If the | 155 // Runs an integrity check on the current database. If the |
156 // integrity check fails, false is returned and error is populated | 156 // integrity check fails, false is returned and error is populated |
157 // with an error message. | 157 // with an error message. |
158 bool CheckIntegrity(sqlite3* handle, string* error) const; | 158 bool CheckIntegrity(sqlite3* handle, std::string* error) const; |
159 | 159 |
160 // Migration utilities. | 160 // Migration utilities. |
161 bool AddColumn(const ColumnSpec* column); | 161 bool AddColumn(const ColumnSpec* column); |
162 bool RefreshColumns(); | 162 bool RefreshColumns(); |
163 bool SetVersion(int version); | 163 bool SetVersion(int version); |
164 int GetVersion(); | 164 int GetVersion(); |
165 bool MigrateToSpecifics(const char* old_columns, | 165 bool MigrateToSpecifics(const char* old_columns, |
166 const char* specifics_column, | 166 const char* specifics_column, |
167 void(*handler_function) ( | 167 void(*handler_function) ( |
168 SQLStatement* old_value_query, | 168 SQLStatement* old_value_query, |
(...skipping 25 matching lines...) Expand all Loading... |
194 // Set to true if migration left some old columns around that need to be | 194 // Set to true if migration left some old columns around that need to be |
195 // discarded. | 195 // discarded. |
196 bool needs_column_refresh_; | 196 bool needs_column_refresh_; |
197 | 197 |
198 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 198 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
199 }; | 199 }; |
200 | 200 |
201 } // namespace syncable | 201 } // namespace syncable |
202 | 202 |
203 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 203 #endif // CHROME_BROWSER_SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
OLD | NEW |