| Index: components/sync/model/model_type_sync_bridge.cc
|
| diff --git a/components/sync/model/model_type_sync_bridge.cc b/components/sync/model/model_type_sync_bridge.cc
|
| index 0e5a1dd454493a2e28acc8ed00d9e05c08488083..e4c6f87b6c1282ffd828a7c44f455530cbabe672 100644
|
| --- a/components/sync/model/model_type_sync_bridge.cc
|
| +++ b/components/sync/model/model_type_sync_bridge.cc
|
| @@ -8,6 +8,7 @@
|
|
|
| #include "base/memory/ptr_util.h"
|
| #include "components/sync/model/metadata_batch.h"
|
| +#include "components/sync/model/metadata_change_list.h"
|
|
|
| namespace syncer {
|
|
|
| @@ -20,6 +21,23 @@ ModelTypeSyncBridge::ModelTypeSyncBridge(
|
|
|
| ModelTypeSyncBridge::~ModelTypeSyncBridge() {}
|
|
|
| +base::Optional<ModelError> ModelTypeSyncBridge::MergeSyncData(
|
| + std::unique_ptr<MetadataChangeList> metadata_change_list,
|
| + EntityChangeList entity_data) {
|
| + EntityDataMap entity_data_map;
|
| + for (const auto& change : entity_data) {
|
| + DCHECK_EQ(EntityChange::ACTION_ADD, change.type());
|
| + DCHECK(!change.storage_key().empty());
|
| + DCHECK(entity_data_map.find(change.storage_key()) == entity_data_map.end());
|
| + entity_data_map.emplace(change.storage_key(), change.data_ptr());
|
| + }
|
| + return MergeSyncData(std::move(metadata_change_list), entity_data_map);
|
| +}
|
| +
|
| +bool ModelTypeSyncBridge::SupportsGetStorageKey() const {
|
| + return true;
|
| +}
|
| +
|
| ConflictResolution ModelTypeSyncBridge::ResolveConflict(
|
| const EntityData& local_data,
|
| const EntityData& remote_data) const {
|
|
|