| 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..d0789b4e6e5de0d3da03b6d3980e5863e169782e
|
| --- /dev/null
|
| +++ b/components/sync/model/recording_model_type_change_processor.h
|
| @@ -0,0 +1,48 @@
|
| +// 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;
|
| +
|
| + // FakeModelTypeChangeProcessor overrides.
|
| + void Put(const std::string& storage_key,
|
| + std::unique_ptr<EntityData> entity_data,
|
| + MetadataChangeList* metadata_changes) override;
|
| + void Delete(const std::string& storage_key,
|
| + MetadataChangeList* metadata_changes) override;
|
| + void ModelReadyToSync(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 {
|
| + return put_multimap_;
|
| + }
|
| +
|
| + const std::set<std::string>& delete_set() const { return delete_set_; }
|
| +
|
| + const MetadataBatch* metadata() const { return metadata_.get(); }
|
| +
|
| + 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_
|
|
|