| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "components/sync/model/model_type_store.h" | 5 #include "components/sync/model/model_type_store.h" |
| 6 | 6 |
| 7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
| 8 #include "components/sync/model_impl/accumulating_metadata_change_list.h" | 8 #include "components/sync/model_impl/accumulating_metadata_change_list.h" |
| 9 #include "components/sync/model_impl/model_type_store_impl.h" | 9 #include "components/sync/model_impl/model_type_store_impl.h" |
| 10 #include "components/sync/model_impl/passthrough_metadata_change_list.h" | 10 #include "components/sync/model_impl/passthrough_metadata_change_list.h" |
| 11 | 11 |
| 12 namespace syncer { | 12 namespace syncer { |
| 13 | 13 |
| 14 // static | 14 // static |
| 15 void ModelTypeStore::CreateInMemoryStoreForTest(ModelType type, | 15 void ModelTypeStore::CreateInMemoryStoreForTest(ModelType type, |
| 16 const InitCallback& callback) { | 16 const InitCallback& callback) { |
| 17 ModelTypeStoreImpl::CreateInMemoryStoreForTest(type, callback); | 17 ModelTypeStoreImpl::CreateInMemoryStoreForTest(type, callback); |
| 18 } | 18 } |
| 19 | 19 |
| 20 // static | 20 // static |
| 21 void ModelTypeStore::CreateStore( | 21 void ModelTypeStore::CreateStore( |
| 22 ModelType type, | 22 ModelType type, |
| 23 const std::string& path, | 23 const std::string& path, |
| 24 scoped_refptr<base::SequencedTaskRunner> blocking_task_runner, | |
| 25 const InitCallback& callback) { | 24 const InitCallback& callback) { |
| 26 ModelTypeStoreImpl::CreateStore(type, path, blocking_task_runner, callback); | 25 ModelTypeStoreImpl::CreateStore(type, path, callback); |
| 27 } | 26 } |
| 28 | 27 |
| 29 ModelTypeStore::~ModelTypeStore() {} | 28 ModelTypeStore::~ModelTypeStore() {} |
| 30 | 29 |
| 31 // static | 30 // static |
| 32 std::unique_ptr<MetadataChangeList> | 31 std::unique_ptr<MetadataChangeList> |
| 33 ModelTypeStore::WriteBatch::CreateMetadataChangeList() { | 32 ModelTypeStore::WriteBatch::CreateMetadataChangeList() { |
| 34 return base::MakeUnique<AccumulatingMetadataChangeList>(); | 33 return base::MakeUnique<AccumulatingMetadataChangeList>(); |
| 35 } | 34 } |
| 36 | 35 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 55 return metadata_change_list_.get(); | 54 return metadata_change_list_.get(); |
| 56 } | 55 } |
| 57 | 56 |
| 58 void ModelTypeStore::WriteBatch::TransferMetadataChanges( | 57 void ModelTypeStore::WriteBatch::TransferMetadataChanges( |
| 59 std::unique_ptr<MetadataChangeList> mcl) { | 58 std::unique_ptr<MetadataChangeList> mcl) { |
| 60 static_cast<AccumulatingMetadataChangeList*>(mcl.get())->TransferChanges( | 59 static_cast<AccumulatingMetadataChangeList*>(mcl.get())->TransferChanges( |
| 61 store_, this); | 60 store_, this); |
| 62 } | 61 } |
| 63 | 62 |
| 64 } // namespace syncer | 63 } // namespace syncer |
| OLD | NEW |