OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "components/sync/model/fake_model_type_sync_bridge.h" | 5 #include "components/sync/model/fake_model_type_sync_bridge.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 if (remote_storage_keys.find(kv.first) == remote_storage_keys.end()) { | 225 if (remote_storage_keys.find(kv.first) == remote_storage_keys.end()) { |
226 change_processor()->Put(kv.first, CopyEntityData(*kv.second), | 226 change_processor()->Put(kv.first, CopyEntityData(*kv.second), |
227 metadata_change_list.get()); | 227 metadata_change_list.get()); |
228 } | 228 } |
229 } | 229 } |
230 | 230 |
231 ApplyMetadataChangeList(std::move(metadata_change_list)); | 231 ApplyMetadataChangeList(std::move(metadata_change_list)); |
232 return {}; | 232 return {}; |
233 } | 233 } |
234 | 234 |
235 base::Optional<ModelError> FakeModelTypeSyncBridge::MergeSyncData( | |
236 std::unique_ptr<MetadataChangeList> metadata_change_list, | |
237 EntityDataMap entity_data) { | |
238 NOTREACHED(); | |
239 return {}; | |
240 } | |
241 | |
242 base::Optional<ModelError> FakeModelTypeSyncBridge::ApplySyncChanges( | 235 base::Optional<ModelError> FakeModelTypeSyncBridge::ApplySyncChanges( |
243 std::unique_ptr<MetadataChangeList> metadata_changes, | 236 std::unique_ptr<MetadataChangeList> metadata_changes, |
244 EntityChangeList entity_changes) { | 237 EntityChangeList entity_changes) { |
245 if (error_next_) { | 238 if (error_next_) { |
246 error_next_ = false; | 239 error_next_ = false; |
247 return ModelError(FROM_HERE, "boom"); | 240 return ModelError(FROM_HERE, "boom"); |
248 } | 241 } |
249 | 242 |
250 for (const EntityChange& change : entity_changes) { | 243 for (const EntityChange& change : entity_changes) { |
251 switch (change.type()) { | 244 switch (change.type()) { |
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
383 new_data->id = old_data.id; | 376 new_data->id = old_data.id; |
384 new_data->client_tag_hash = old_data.client_tag_hash; | 377 new_data->client_tag_hash = old_data.client_tag_hash; |
385 new_data->non_unique_name = old_data.non_unique_name; | 378 new_data->non_unique_name = old_data.non_unique_name; |
386 new_data->specifics = old_data.specifics; | 379 new_data->specifics = old_data.specifics; |
387 new_data->creation_time = old_data.creation_time; | 380 new_data->creation_time = old_data.creation_time; |
388 new_data->modification_time = old_data.modification_time; | 381 new_data->modification_time = old_data.modification_time; |
389 return new_data; | 382 return new_data; |
390 } | 383 } |
391 | 384 |
392 } // namespace syncer | 385 } // namespace syncer |
OLD | NEW |