| 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 #ifndef SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ | 5 #ifndef SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ |
| 6 #define SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ | 6 #define SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ |
| 7 | 7 |
| 8 #include "sync/api/metadata_change_list.h" | 8 #include "sync/api/metadata_change_list.h" |
| 9 #include "sync/api/model_type_store.h" | 9 #include "sync/api/model_type_store.h" |
| 10 #include "sync/base/sync_export.h" | 10 #include "sync/base/sync_export.h" |
| 11 | 11 |
| 12 namespace syncer_v2 { | 12 namespace syncer_v2 { |
| 13 | 13 |
| 14 // A MetadataChangeList implementation that is meant to be used in combination | 14 // A MetadataChangeList implementation that is meant to be used in combination |
| 15 // with a ModelTypeStore. It accumulates changes in member fields, and then when | 15 // with a ModelTypeStore. It accumulates changes in member fields, and then when |
| 16 // requested transfers them to the store/write batch. | 16 // requested transfers them to the store/write batch. |
| 17 class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList { | 17 class SYNC_EXPORT SimpleMetadataChangeList : public MetadataChangeList { |
| 18 public: | 18 public: |
| 19 SimpleMetadataChangeList(); | 19 SimpleMetadataChangeList(); |
| 20 ~SimpleMetadataChangeList() override; | 20 ~SimpleMetadataChangeList() override; |
| 21 | 21 |
| 22 void UpdateDataTypeState(const DataTypeState& data_type_state) override; |
| 23 void ClearDataTypeState() override; |
| 24 void UpdateMetadata(const std::string& client_tag, |
| 25 const sync_pb::EntityMetadata& metadata) override; |
| 26 void ClearMetadata(const std::string& client_tag) override; |
| 27 |
| 22 // Moves all currently accumulated changes into the write batch, clear out | 28 // Moves all currently accumulated changes into the write batch, clear out |
| 23 // local copies. Calling this multiple times will work, but should not be | 29 // local copies. Calling this multiple times will work, but should not be |
| 24 // necessary. | 30 // necessary. |
| 25 void TranfserChanges(ModelTypeStore* store, | 31 void TranfserChanges(ModelTypeStore* store, |
| 26 ModelTypeStore::WriteBatch* write_batch); | 32 ModelTypeStore::WriteBatch* write_batch); |
| 27 }; | 33 }; |
| 28 | 34 |
| 29 } // namespace syncer_v2 | 35 } // namespace syncer_v2 |
| 30 | 36 |
| 31 #endif // SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ | 37 #endif // SYNC_INTERNAL_API_PUBLIC_SIMPLE_METADATA_CHANGE_LIST_H_ |
| OLD | NEW |