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

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

Issue 2473553003: [Sync] Improve MetadataChangeList usage for types using ModelTypeStore. (Closed)
Patch Set: Fix comments + protected constructor. 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.cc
diff --git a/components/sync/model_impl/model_type_store_impl.cc b/components/sync/model_impl/model_type_store_impl.cc
index 74bff7cbe8bcc6d3816c77e8a9792287a4945c28..26da6d5b9ab5f8b16cfb7cc8f8e3d5fdc45d4ef7 100644
--- a/components/sync/model_impl/model_type_store_impl.cc
+++ b/components/sync/model_impl/model_type_store_impl.cc
@@ -270,7 +270,7 @@ void ModelTypeStoreImpl::ReadAllMetadataDone(
std::unique_ptr<ModelTypeStore::WriteBatch>
ModelTypeStoreImpl::CreateWriteBatch() {
DCHECK(CalledOnValidThread());
- return base::MakeUnique<WriteBatchImpl>();
+ return base::MakeUnique<WriteBatchImpl>(this);
}
void ModelTypeStoreImpl::CommitWriteBatch(
@@ -333,7 +333,8 @@ void ModelTypeStoreImpl::DeleteGlobalMetadata(WriteBatch* write_batch) {
GetLeveldbWriteBatch(write_batch)->Delete(kGlobalMetadataKey);
}
-ModelTypeStoreImpl::WriteBatchImpl::WriteBatchImpl() {
+ModelTypeStoreImpl::WriteBatchImpl::WriteBatchImpl(ModelTypeStore* store)
+ : WriteBatch(store) {
leveldb_write_batch_ = base::MakeUnique<leveldb::WriteBatch>();
}
« no previous file with comments | « components/sync/model_impl/model_type_store_impl.h ('k') | components/sync/model_impl/shared_model_type_processor_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698