| 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/device_info/device_info_sync_bridge.h" | 5 #include "components/sync/device_info/device_info_sync_bridge.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 std::unique_ptr<EntityData> entity_data, | 183 std::unique_ptr<EntityData> entity_data, |
| 184 MetadataChangeList* metadata_changes) override { | 184 MetadataChangeList* metadata_changes) override { |
| 185 put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data))); | 185 put_multimap_.insert(std::make_pair(storage_key, std::move(entity_data))); |
| 186 } | 186 } |
| 187 | 187 |
| 188 void Delete(const std::string& storage_key, | 188 void Delete(const std::string& storage_key, |
| 189 MetadataChangeList* metadata_changes) override { | 189 MetadataChangeList* metadata_changes) override { |
| 190 delete_set_.insert(storage_key); | 190 delete_set_.insert(storage_key); |
| 191 } | 191 } |
| 192 | 192 |
| 193 void OnMetadataLoaded(std::unique_ptr<MetadataBatch> batch) override { | 193 void ModelReadyToSync(std::unique_ptr<MetadataBatch> batch) override { |
| 194 std::swap(metadata_, batch); | 194 std::swap(metadata_, batch); |
| 195 } | 195 } |
| 196 | 196 |
| 197 const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap() | 197 const std::multimap<std::string, std::unique_ptr<EntityData>>& put_multimap() |
| 198 const { | 198 const { |
| 199 return put_multimap_; | 199 return put_multimap_; |
| 200 } | 200 } |
| 201 const std::set<std::string>& delete_set() const { return delete_set_; } | 201 const std::set<std::string>& delete_set() const { return delete_set_; } |
| 202 const MetadataBatch* metadata() const { return metadata_.get(); } | 202 const MetadataBatch* metadata() const { return metadata_.get(); } |
| 203 | 203 |
| (...skipping 607 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 | 811 |
| 812 // Reloading from storage shouldn't contain remote data. | 812 // Reloading from storage shouldn't contain remote data. |
| 813 RestartBridge(); | 813 RestartBridge(); |
| 814 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size()); | 814 EXPECT_EQ(1u, bridge()->GetAllDeviceInfo().size()); |
| 815 EXPECT_EQ(4, change_count()); | 815 EXPECT_EQ(4, change_count()); |
| 816 } | 816 } |
| 817 | 817 |
| 818 } // namespace | 818 } // namespace |
| 819 | 819 |
| 820 } // namespace syncer | 820 } // namespace syncer |
| OLD | NEW |