Index: components/sync/model_impl/model_type_store_backend.h |
diff --git a/components/sync/model_impl/model_type_store_backend.h b/components/sync/model_impl/model_type_store_backend.h |
index e7d375d2ba5b8d688032a5fe21d9e1ac1c047319..4c99ad24bea51e434282809279e14fe4c1eefd83 100644 |
--- a/components/sync/model_impl/model_type_store_backend.h |
+++ b/components/sync/model_impl/model_type_store_backend.h |
@@ -67,6 +67,9 @@ class ModelTypeStoreBackend |
friend class base::RefCountedThreadSafe<ModelTypeStoreBackend>; |
friend class ModelTypeStoreBackendTest; |
+ static const int64_t kLatestSchemaVersion; |
+ static const char kDBSchemaDescriptorRecordId[]; |
+ |
explicit ModelTypeStoreBackend(const std::string& path); |
~ModelTypeStoreBackend(); |
@@ -97,6 +100,20 @@ class ModelTypeStoreBackend |
ModelTypeStore::Result Init(const std::string& path, |
std::unique_ptr<leveldb::Env> env); |
+ // Attempts to read and return the database's version. |
+ // If there is not a schema descriptor present, the value returned is 0. |
+ // If an error occurs, the value returned is kInvalidSchemaVersion(-1). |
+ int64_t GetStoreVersion(); |
+ |
+ // Migrate the db schema from |current_version| to |desired_version|, |
+ // returning true on success. |
+ ModelTypeStore::Result Migrate(int64_t current_version, |
+ int64_t desired_version); |
+ |
+ // Migrates from no version record at all (version 0) to version 1 of |
+ // the schema, returning true on success. |
+ bool Migrate0To1(); |
+ |
// Macro wrapped mutex to guard against concurrent calls in debug builds. |
DFAKE_MUTEX(push_pop_); |