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