1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "components/sync/model/model_type_store_base.h"
6 
7 #include "components/sync/model_impl/in_memory_metadata_change_list.h"
8 
9 namespace syncer {
10 
11 // static
12 std::unique_ptr<MetadataChangeList>
CreateMetadataChangeList()13 ModelTypeStoreBase::WriteBatch::CreateMetadataChangeList() {
14   return std::make_unique<InMemoryMetadataChangeList>();
15 }
16 
WriteBatch()17 ModelTypeStoreBase::WriteBatch::WriteBatch() {}
18 
~WriteBatch()19 ModelTypeStoreBase::WriteBatch::~WriteBatch() {}
20 
TakeMetadataChangesFrom(std::unique_ptr<MetadataChangeList> mcl)21 void ModelTypeStoreBase::WriteBatch::TakeMetadataChangesFrom(
22     std::unique_ptr<MetadataChangeList> mcl) {
23   static_cast<InMemoryMetadataChangeList*>(mcl.get())->TransferChangesTo(
24       GetMetadataChangeList());
25 }
26 
27 ModelTypeStoreBase::ModelTypeStoreBase() = default;
28 
29 ModelTypeStoreBase::~ModelTypeStoreBase() = default;
30 
31 }  // namespace syncer
32