OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
119 static ModelType ModelIdToModelTypeEnum(const void* data, int length); | 119 static ModelType ModelIdToModelTypeEnum(const void* data, int length); |
120 static std::string ModelTypeEnumToModelId(ModelType model_type); | 120 static std::string ModelTypeEnumToModelId(ModelType model_type); |
121 | 121 |
122 static std::string GenerateCacheGUID(); | 122 static std::string GenerateCacheGUID(); |
123 | 123 |
124 // Runs an integrity check on the current database. If the | 124 // Runs an integrity check on the current database. If the |
125 // integrity check fails, false is returned and error is populated | 125 // integrity check fails, false is returned and error is populated |
126 // with an error message. | 126 // with an error message. |
127 bool CheckIntegrity(sqlite3* handle, std::string* error) const; | 127 bool CheckIntegrity(sqlite3* handle, std::string* error) const; |
128 | 128 |
| 129 // Checks that the references between sync nodes is consistent. |
| 130 static bool VerifyReferenceIntegrity(const MetahandlesIndex& entries); |
| 131 |
129 // Migration utilities. | 132 // Migration utilities. |
130 bool RefreshColumns(); | 133 bool RefreshColumns(); |
131 bool SetVersion(int version); | 134 bool SetVersion(int version); |
132 int GetVersion(); | 135 int GetVersion(); |
133 | 136 |
134 bool MigrateToSpecifics(const char* old_columns, | 137 bool MigrateToSpecifics(const char* old_columns, |
135 const char* specifics_column, | 138 const char* specifics_column, |
136 void(*handler_function) ( | 139 void(*handler_function) ( |
137 sql::Statement* old_value_query, | 140 sql::Statement* old_value_query, |
138 int old_value_column, | 141 int old_value_column, |
(...skipping 20 matching lines...) Expand all Loading... |
159 // discarded. | 162 // discarded. |
160 bool needs_column_refresh_; | 163 bool needs_column_refresh_; |
161 | 164 |
162 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); | 165 DISALLOW_COPY_AND_ASSIGN(DirectoryBackingStore); |
163 }; | 166 }; |
164 | 167 |
165 } // namespace syncable | 168 } // namespace syncable |
166 } // namespace syncer | 169 } // namespace syncer |
167 | 170 |
168 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ | 171 #endif // SYNC_SYNCABLE_DIRECTORY_BACKING_STORE_H_ |
OLD | NEW |