OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/user_events/user_event_sync_bridge.h" | 5 #include "components/sync/user_events/user_event_sync_bridge.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "base/big_endian.h" | 9 #include "base/big_endian.h" |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 | 69 |
70 UserEventSyncBridge::~UserEventSyncBridge() {} | 70 UserEventSyncBridge::~UserEventSyncBridge() {} |
71 | 71 |
72 std::unique_ptr<MetadataChangeList> | 72 std::unique_ptr<MetadataChangeList> |
73 UserEventSyncBridge::CreateMetadataChangeList() { | 73 UserEventSyncBridge::CreateMetadataChangeList() { |
74 return WriteBatch::CreateMetadataChangeList(); | 74 return WriteBatch::CreateMetadataChangeList(); |
75 } | 75 } |
76 | 76 |
77 base::Optional<ModelError> UserEventSyncBridge::MergeSyncData( | 77 base::Optional<ModelError> UserEventSyncBridge::MergeSyncData( |
78 std::unique_ptr<MetadataChangeList> metadata_change_list, | 78 std::unique_ptr<MetadataChangeList> metadata_change_list, |
79 EntityDataMap entity_data_map) { | 79 EntityChangeList entity_data) { |
80 NOTREACHED(); | 80 NOTREACHED(); |
81 return {}; | 81 return {}; |
82 } | 82 } |
83 | 83 |
84 base::Optional<ModelError> UserEventSyncBridge::ApplySyncChanges( | 84 base::Optional<ModelError> UserEventSyncBridge::ApplySyncChanges( |
85 std::unique_ptr<MetadataChangeList> metadata_change_list, | 85 std::unique_ptr<MetadataChangeList> metadata_change_list, |
86 EntityChangeList entity_changes) { | 86 EntityChangeList entity_changes) { |
87 std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch(); | 87 std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch(); |
88 for (EntityChange& change : entity_changes) { | 88 for (EntityChange& change : entity_changes) { |
89 DCHECK_EQ(EntityChange::ACTION_DELETE, change.type()); | 89 DCHECK_EQ(EntityChange::ACTION_DELETE, change.type()); |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch(); | 213 std::unique_ptr<WriteBatch> batch = store_->CreateWriteBatch(); |
214 for (const Record& r : *data_records) { | 214 for (const Record& r : *data_records) { |
215 batch->DeleteData(r.id); | 215 batch->DeleteData(r.id); |
216 } | 216 } |
217 store_->CommitWriteBatch( | 217 store_->CommitWriteBatch( |
218 std::move(batch), | 218 std::move(batch), |
219 base::Bind(&UserEventSyncBridge::OnCommit, base::AsWeakPtr(this))); | 219 base::Bind(&UserEventSyncBridge::OnCommit, base::AsWeakPtr(this))); |
220 } | 220 } |
221 | 221 |
222 } // namespace syncer | 222 } // namespace syncer |
OLD | NEW |