Chromium Code Reviews| Index: components/sync/model/recording_model_type_change_processor.cc |
| diff --git a/components/sync/model/recording_model_type_change_processor.cc b/components/sync/model/recording_model_type_change_processor.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f0ce6614e73bc1de5ef2bd51fdb443c50832900f |
| --- /dev/null |
| +++ b/components/sync/model/recording_model_type_change_processor.cc |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2017 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "components/sync/model/recording_model_type_change_processor.h" |
| + |
| +#include "components/sync/model/fake_model_type_change_processor.h" |
| +#include "components/sync/model/metadata_batch.h" |
| + |
| +namespace syncer { |
| + |
| +RecordingModelTypeChangeProcessor::RecordingModelTypeChangeProcessor() {} |
| + |
| +RecordingModelTypeChangeProcessor::~RecordingModelTypeChangeProcessor() {} |
| + |
| +void RecordingModelTypeChangeProcessor::Put( |
| + const std::string& storage_key, |
| + std::unique_ptr<EntityData> entity_data, |
| + MetadataChangeList* metadata_changes) { |
| + put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data))); |
| +} |
| + |
| +void RecordingModelTypeChangeProcessor::Delete( |
| + const std::string& storage_key, |
| + MetadataChangeList* metadata_changes) { |
| + delete_set_.insert(storage_key); |
| +} |
| + |
| +void RecordingModelTypeChangeProcessor::OnMetadataLoaded( |
| + std::unique_ptr<MetadataBatch> batch) { |
| + std::swap(metadata_, batch); |
| +} |
| + |
| +bool RecordingModelTypeChangeProcessor::IsTrackingMetadata() { |
| + return is_tracking_metadata_; |
| +} |
| + |
| +void RecordingModelTypeChangeProcessor::SetIsTrackingMetadata( |
| + bool is_tracking) { |
| + is_tracking_metadata_ = is_tracking; |
| +} |
| + |
| +const std::multimap<std::string, std::unique_ptr<EntityData>>& |
| +RecordingModelTypeChangeProcessor::put_multimap() const { |
| + return put_multimap_; |
|
maxbogue
2017/01/12 01:33:36
This function and the two below can be defined inl
Patrick Noland
2017/01/13 23:31:52
Done.
|
| +} |
| +const std::set<std::string>& RecordingModelTypeChangeProcessor::delete_set() |
| + const { |
| + return delete_set_; |
| +} |
| +const MetadataBatch* RecordingModelTypeChangeProcessor::metadata() const { |
| + return metadata_.get(); |
| +} |
| + |
| +} // namespace syncer |