| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2016 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 #ifndef COMPONENTS_SYNC_MODEL_IMPL_ACCUMULATING_METADATA_CHANGE_LIST_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_IMPL_ACCUMULATING_METADATA_CHANGE_LIST_H_ |
| 7 |
| 8 #include <map> |
| 9 #include <memory> |
| 10 #include <string> |
| 11 |
| 12 #include "components/sync/engine/non_blocking_sync_common.h" |
| 13 #include "components/sync/model/model_type_store.h" |
| 14 #include "components/sync/model_impl/in_memory_metadata_change_list.h" |
| 15 #include "components/sync/protocol/entity_metadata.pb.h" |
| 16 #include "components/sync/protocol/model_type_state.pb.h" |
| 17 |
| 18 namespace syncer { |
| 19 |
| 20 // A MetadataChangeList implementation that is meant to be used in combination |
| 21 // with a ModelTypeStore. It accumulates changes in member fields, and then when |
| 22 // requested transfers them to the store/write batch. |
| 23 class AccumulatingMetadataChangeList : public InMemoryMetadataChangeList { |
| 24 public: |
| 25 AccumulatingMetadataChangeList(); |
| 26 ~AccumulatingMetadataChangeList() override; |
| 27 |
| 28 // Moves all currently accumulated changes into the write batch, clear out |
| 29 // local copies. Calling this multiple times will work, but should not be |
| 30 // necessary. |
| 31 void TransferChanges(ModelTypeStore* store, |
| 32 ModelTypeStore::WriteBatch* write_batch); |
| 33 }; |
| 34 |
| 35 } // namespace syncer |
| 36 |
| 37 #endif // COMPONENTS_SYNC_MODEL_IMPL_ACCUMULATING_METADATA_CHANGE_LIST_H_ |
| OLD | NEW |