Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(189)

Unified Diff: components/sync/device_info/device_info_sync_bridge.cc

Issue 2923363004: [Sync] Migrate bridge implementations to change list based MergeSyncData (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: components/sync/device_info/device_info_sync_bridge.cc
diff --git a/components/sync/device_info/device_info_sync_bridge.cc b/components/sync/device_info/device_info_sync_bridge.cc
index caba36324ceb54d07ec723561b293223e21b4fda..79c0f0cf9d5b63fc69394cddbcafbcb45c7e78e9 100644
--- a/components/sync/device_info/device_info_sync_bridge.cc
+++ b/components/sync/device_info/device_info_sync_bridge.cc
@@ -114,7 +114,7 @@ DeviceInfoSyncBridge::CreateMetadataChangeList() {
base::Optional<ModelError> DeviceInfoSyncBridge::MergeSyncData(
std::unique_ptr<MetadataChangeList> metadata_change_list,
- EntityDataMap entity_data_map) {
+ EntityChangeList entity_data) {
DCHECK(has_provider_initialized_);
DCHECK(change_processor()->IsTrackingMetadata());
const DeviceInfo* local_info =
@@ -138,10 +138,10 @@ base::Optional<ModelError> DeviceInfoSyncBridge::MergeSyncData(
bool has_changes = false;
std::string local_guid = local_info->guid();
std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch();
- for (const auto& kv : entity_data_map) {
+ for (const auto& change : entity_data) {
const DeviceInfoSpecifics& specifics =
- kv.second.value().specifics.device_info();
- DCHECK_EQ(kv.first, specifics.cache_guid());
+ change.data().specifics.device_info();
+ DCHECK_EQ(change.storage_key(), specifics.cache_guid());
if (specifics.cache_guid() == local_guid) {
// Don't Put local data if it's the same as the remote copy.
if (local_info->Equals(*SpecificsToModel(specifics))) {
« no previous file with comments | « components/sync/device_info/device_info_sync_bridge.h ('k') | components/sync/device_info/device_info_sync_bridge_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698