| 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 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ |
| 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 } // namespace sync_pb | 27 } // namespace sync_pb |
| 28 | 28 |
| 29 namespace syncer { | 29 namespace syncer { |
| 30 | 30 |
| 31 // Sync bridge implementation for DEVICE_INFO model type. Handles storage of | 31 // Sync bridge implementation for DEVICE_INFO model type. Handles storage of |
| 32 // device info and associated sync metadata, applying/merging foreign changes, | 32 // device info and associated sync metadata, applying/merging foreign changes, |
| 33 // and allows public read access. | 33 // and allows public read access. |
| 34 class DeviceInfoSyncBridge : public ModelTypeSyncBridge, | 34 class DeviceInfoSyncBridge : public ModelTypeSyncBridge, |
| 35 public DeviceInfoTracker { | 35 public DeviceInfoTracker { |
| 36 public: | 36 public: |
| 37 typedef base::Callback<void(const ModelTypeStore::InitCallback& callback)> | |
| 38 StoreFactoryFunction; | |
| 39 | |
| 40 DeviceInfoSyncBridge(LocalDeviceInfoProvider* local_device_info_provider, | 37 DeviceInfoSyncBridge(LocalDeviceInfoProvider* local_device_info_provider, |
| 41 const StoreFactoryFunction& callback, | 38 const ModelTypeStoreFactory& store_factory, |
| 42 const ChangeProcessorFactory& change_processor_factory); | 39 const ChangeProcessorFactory& change_processor_factory); |
| 43 ~DeviceInfoSyncBridge() override; | 40 ~DeviceInfoSyncBridge() override; |
| 44 | 41 |
| 45 // ModelTypeSyncBridge implementation. | 42 // ModelTypeSyncBridge implementation. |
| 46 std::unique_ptr<MetadataChangeList> CreateMetadataChangeList() override; | 43 std::unique_ptr<MetadataChangeList> CreateMetadataChangeList() override; |
| 47 base::Optional<ModelError> MergeSyncData( | 44 base::Optional<ModelError> MergeSyncData( |
| 48 std::unique_ptr<MetadataChangeList> metadata_change_list, | 45 std::unique_ptr<MetadataChangeList> metadata_change_list, |
| 49 EntityDataMap entity_data_map) override; | 46 EntityDataMap entity_data_map) override; |
| 50 base::Optional<ModelError> ApplySyncChanges( | 47 base::Optional<ModelError> ApplySyncChanges( |
| 51 std::unique_ptr<MetadataChangeList> metadata_change_list, | 48 std::unique_ptr<MetadataChangeList> metadata_change_list, |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 138 |
| 142 // Used to update our local device info once every pulse interval. | 139 // Used to update our local device info once every pulse interval. |
| 143 base::OneShotTimer pulse_timer_; | 140 base::OneShotTimer pulse_timer_; |
| 144 | 141 |
| 145 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncBridge); | 142 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncBridge); |
| 146 }; | 143 }; |
| 147 | 144 |
| 148 } // namespace syncer | 145 } // namespace syncer |
| 149 | 146 |
| 150 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ | 147 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ |
| OLD | NEW |