Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(792)

Unified Diff: components/sync/model_impl/model_type_store_impl.h

Issue 2468183005: [Sync] Prepend global metadata key with model type prefix (Closed)
Patch Set: Addressed comments. Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/model_impl/model_type_store_impl.h
diff --git a/components/sync/model_impl/model_type_store_impl.h b/components/sync/model_impl/model_type_store_impl.h
index 57bb9807d4fd44b9dafa0d4e64e97477f171f1ed..1810afc611779135617bd37e9e843c3fb3ae9049 100644
--- a/components/sync/model_impl/model_type_store_impl.h
+++ b/components/sync/model_impl/model_type_store_impl.h
@@ -30,11 +30,12 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
~ModelTypeStoreImpl() override;
static void CreateStore(
- const ModelType type,
+ ModelType type,
const std::string& path,
scoped_refptr<base::SequencedTaskRunner> blocking_task_runner,
const InitCallback& callback);
- static void CreateInMemoryStoreForTest(const InitCallback& callback);
+ static void CreateInMemoryStoreForTest(ModelType type,
+ const InitCallback& callback);
// ModelTypeStore implementation.
void ReadData(const IdList& id_list,
@@ -71,10 +72,6 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
const InitCallback& callback,
scoped_refptr<ModelTypeStoreBackend> backend);
- // Format prefix key for data/metadata records with |type|.
- static std::string FormatDataPrefix(const ModelType type);
- static std::string FormatMetaPrefix(const ModelType type);
-
static leveldb::WriteBatch* GetLeveldbWriteBatch(WriteBatch* write_batch);
// Format key for data/metadata records with given id.
@@ -115,6 +112,9 @@ class ModelTypeStoreImpl : public ModelTypeStore, public base::NonThreadSafe {
const std::string data_prefix_;
const std::string metadata_prefix_;
+ // Key for this type's global metadata record.
+ const std::string global_metadata_key_;
+
base::WeakPtrFactory<ModelTypeStoreImpl> weak_ptr_factory_;
};
« no previous file with comments | « components/sync/model/model_type_store_test_util.cc ('k') | components/sync/model_impl/model_type_store_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698