| 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 void NotifyObservers(); | 85 void NotifyObservers(); |
| 86 | 86 |
| 87 // Used as callback given to LocalDeviceInfoProvider. | 87 // Used as callback given to LocalDeviceInfoProvider. |
| 88 void OnProviderInitialized(); | 88 void OnProviderInitialized(); |
| 89 | 89 |
| 90 // Methods used as callbacks given to DataTypeStore. | 90 // Methods used as callbacks given to DataTypeStore. |
| 91 void OnStoreCreated(ModelTypeStore::Result result, | 91 void OnStoreCreated(ModelTypeStore::Result result, |
| 92 std::unique_ptr<ModelTypeStore> store); | 92 std::unique_ptr<ModelTypeStore> store); |
| 93 void OnReadAllData(ModelTypeStore::Result result, | 93 void OnReadAllData(ModelTypeStore::Result result, |
| 94 std::unique_ptr<ModelTypeStore::RecordList> record_list); | 94 std::unique_ptr<ModelTypeStore::RecordList> record_list); |
| 95 void OnReadAllMetadata( | 95 void OnReadAllMetadata(SyncError error, |
| 96 ModelTypeStore::Result result, | 96 std::unique_ptr<MetadataBatch> metadata_batch); |
| 97 std::unique_ptr<ModelTypeStore::RecordList> metadata_records, | |
| 98 const std::string& global_metadata); | |
| 99 void OnCommit(ModelTypeStore::Result result); | 97 void OnCommit(ModelTypeStore::Result result); |
| 100 | 98 |
| 101 // Load metadata if the data is loaded and the provider is initialized. | 99 // Load metadata if the data is loaded and the provider is initialized. |
| 102 void LoadMetadataIfReady(); | 100 void LoadMetadataIfReady(); |
| 103 | 101 |
| 104 // Performs reconciliation between the locally provided device info and the | 102 // Performs reconciliation between the locally provided device info and the |
| 105 // stored device info data. If the sets of data differ, then we consider this | 103 // stored device info data. If the sets of data differ, then we consider this |
| 106 // a local change and we send it to the processor. | 104 // a local change and we send it to the processor. |
| 107 void ReconcileLocalAndStored(); | 105 void ReconcileLocalAndStored(); |
| 108 | 106 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 | 146 |
| 149 // Used to update our local device info once every pulse interval. | 147 // Used to update our local device info once every pulse interval. |
| 150 base::OneShotTimer pulse_timer_; | 148 base::OneShotTimer pulse_timer_; |
| 151 | 149 |
| 152 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncBridge); | 150 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncBridge); |
| 153 }; | 151 }; |
| 154 | 152 |
| 155 } // namespace syncer | 153 } // namespace syncer |
| 156 | 154 |
| 157 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ | 155 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_BRIDGE_H_ |
| OLD | NEW |