Chromium Code Reviews| Index: components/sync/model/recording_model_type_change_processor.h |
| diff --git a/components/sync/model/recording_model_type_change_processor.h b/components/sync/model/recording_model_type_change_processor.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e883c4789202a9c193e17d5e7dbc32dc70f66db4 |
| --- /dev/null |
| +++ b/components/sync/model/recording_model_type_change_processor.h |
| @@ -0,0 +1,46 @@ |
| +// 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. |
| + |
| +#ifndef COMPONENTS_SYNC_MODEL_RECORDING_MODEL_TYPE_CHANGE_PROCESSOR_H_ |
| +#define COMPONENTS_SYNC_MODEL_RECORDING_MODEL_TYPE_CHANGE_PROCESSOR_H_ |
| + |
| +#include "components/sync/model/fake_model_type_change_processor.h" |
| + |
| +namespace syncer { |
| + |
| +// Augmented FakeModelTypeChangeProcessor that accumulates all instructions in |
| +// members that can then be accessed for verification. |
| +class RecordingModelTypeChangeProcessor : public FakeModelTypeChangeProcessor { |
| + public: |
| + RecordingModelTypeChangeProcessor(); |
| + ~RecordingModelTypeChangeProcessor() override; |
| + |
| + void Put(const std::string& storage_key, |
| + std::unique_ptr<EntityData> entity_data, |
| + MetadataChangeList* metadata_changes) override; |
| + |
|
maxbogue
2017/01/12 01:33:36
nit: generally we don't have blank lines between i
Patrick Noland
2017/01/13 23:31:52
Done.
|
| + void Delete(const std::string& storage_key, |
| + MetadataChangeList* metadata_changes) override; |
| + |
| + void OnMetadataLoaded(std::unique_ptr<MetadataBatch> batch) override; |
| + |
| + bool IsTrackingMetadata() override; |
| + |
| + void SetIsTrackingMetadata(bool is_tracking); |
| + |
| + const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap() |
| + const; |
| + const std::set<std::string>& delete_set() const; |
| + const MetadataBatch* metadata() const; |
| + |
| + private: |
| + std::multimap<std::string, std::unique_ptr<EntityData>> put_multimap_; |
| + std::set<std::string> delete_set_; |
| + std::unique_ptr<MetadataBatch> metadata_; |
| + bool is_tracking_metadata_ = true; |
| +}; |
| + |
| +} // namespace syncer |
| + |
| +#endif // COMPONENTS_SYNC_MODEL_RECORDING_MODEL_TYPE_CHANGE_PROCESSOR_H_ |