| 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_PASSTHROUGH_METADATA_CHANGE_LIST_H_ |
| 6 #define COMPONENTS_SYNC_MODEL_IMPL_PASSTHROUGH_METADATA_CHANGE_LIST_H_ |
| 7 |
| 8 #include <string> |
| 9 |
| 10 #include "components/sync/model/metadata_change_list.h" |
| 11 #include "components/sync/model/model_type_store.h" |
| 12 |
| 13 namespace syncer { |
| 14 |
| 15 // A thin wrapper around ModelTypeStore and WriteBatch to implement the |
| 16 // MetadataChangeList interface. This class should never outlive any of the |
| 17 // delegate objects it calls. |
| 18 class PassthroughMetadataChangeList : public MetadataChangeList { |
| 19 public: |
| 20 PassthroughMetadataChangeList(ModelTypeStore* store, |
| 21 ModelTypeStore::WriteBatch* batch); |
| 22 |
| 23 // DataBatch MetadataChangeList. |
| 24 void UpdateModelTypeState( |
| 25 const sync_pb::ModelTypeState& model_type_state) override; |
| 26 void ClearModelTypeState() override; |
| 27 void UpdateMetadata(const std::string& storage_key, |
| 28 const sync_pb::EntityMetadata& metadata) override; |
| 29 void ClearMetadata(const std::string& storage_key) override; |
| 30 |
| 31 private: |
| 32 // Non owning references. |
| 33 ModelTypeStore* store_; |
| 34 ModelTypeStore::WriteBatch* batch_; |
| 35 }; |
| 36 |
| 37 } // namespace syncer |
| 38 |
| 39 #endif // COMPONENTS_SYNC_MODEL_IMPL_PASSTHROUGH_METADATA_CHANGE_LIST_H_ |
| OLD | NEW |