| 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_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 void GetData(StorageKeyList storage_keys, DataCallback callback) override; | 65 void GetData(StorageKeyList storage_keys, DataCallback callback) override; |
| 66 void GetAllData(DataCallback callback) override; | 66 void GetAllData(DataCallback callback) override; |
| 67 std::string GetClientTag(const syncer_v2::EntityData& entity_data) override; | 67 std::string GetClientTag(const syncer_v2::EntityData& entity_data) override; |
| 68 std::string GetStorageKey(const syncer_v2::EntityData& entity_data) override; | 68 std::string GetStorageKey(const syncer_v2::EntityData& entity_data) override; |
| 69 void OnChangeProcessorSet() override; | 69 void OnChangeProcessorSet() override; |
| 70 | 70 |
| 71 // DeviceInfoTracker implementation. | 71 // DeviceInfoTracker implementation. |
| 72 bool IsSyncing() const override; | 72 bool IsSyncing() const override; |
| 73 std::unique_ptr<sync_driver::DeviceInfo> GetDeviceInfo( | 73 std::unique_ptr<sync_driver::DeviceInfo> GetDeviceInfo( |
| 74 const std::string& client_id) const override; | 74 const std::string& client_id) const override; |
| 75 ScopedVector<sync_driver::DeviceInfo> GetAllDeviceInfo() const override; | 75 std::vector<std::unique_ptr<sync_driver::DeviceInfo>> GetAllDeviceInfo() |
| 76 const override; |
| 76 void AddObserver(Observer* observer) override; | 77 void AddObserver(Observer* observer) override; |
| 77 void RemoveObserver(Observer* observer) override; | 78 void RemoveObserver(Observer* observer) override; |
| 78 int CountActiveDevices() const override; | 79 int CountActiveDevices() const override; |
| 79 | 80 |
| 80 private: | 81 private: |
| 81 friend class DeviceInfoServiceTest; | 82 friend class DeviceInfoServiceTest; |
| 82 | 83 |
| 83 // Cache of all syncable and local data, stored by device cache guid. | 84 // Cache of all syncable and local data, stored by device cache guid. |
| 84 using ClientIdToSpecifics = | 85 using ClientIdToSpecifics = |
| 85 std::map<std::string, std::unique_ptr<sync_pb::DeviceInfoSpecifics>>; | 86 std::map<std::string, std::unique_ptr<sync_pb::DeviceInfoSpecifics>>; |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 179 | 180 |
| 180 // Used to update our local device info once every pulse interval. | 181 // Used to update our local device info once every pulse interval. |
| 181 base::OneShotTimer pulse_timer_; | 182 base::OneShotTimer pulse_timer_; |
| 182 | 183 |
| 183 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); | 184 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); |
| 184 }; | 185 }; |
| 185 | 186 |
| 186 } // namespace sync_driver_v2 | 187 } // namespace sync_driver_v2 |
| 187 | 188 |
| 188 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ | 189 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ |
| OLD | NEW |