OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_SERVICE_H_ |
6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_SERVICE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
11 #include <memory> | 11 #include <memory> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/macros.h" | 14 #include "base/macros.h" |
15 #include "base/memory/scoped_vector.h" | |
16 #include "base/observer_list.h" | 15 #include "base/observer_list.h" |
17 #include "base/time/time.h" | 16 #include "base/time/time.h" |
18 #include "base/timer/timer.h" | 17 #include "base/timer/timer.h" |
19 #include "components/sync/api/sync_change.h" | 18 #include "components/sync/api/sync_change.h" |
20 #include "components/sync/api/sync_change_processor.h" | 19 #include "components/sync/api/sync_change_processor.h" |
21 #include "components/sync/api/sync_data.h" | 20 #include "components/sync/api/sync_data.h" |
22 #include "components/sync/api/sync_error_factory.h" | 21 #include "components/sync/api/sync_error_factory.h" |
23 #include "components/sync/api/syncable_service.h" | 22 #include "components/sync/api/syncable_service.h" |
24 #include "components/sync/device_info/device_info_tracker.h" | 23 #include "components/sync/device_info/device_info_tracker.h" |
25 | 24 |
(...skipping 18 matching lines...) Expand all Loading... |
44 void StopSyncing(syncer::ModelType type) override; | 43 void StopSyncing(syncer::ModelType type) override; |
45 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; | 44 syncer::SyncDataList GetAllSyncData(syncer::ModelType type) const override; |
46 syncer::SyncError ProcessSyncChanges( | 45 syncer::SyncError ProcessSyncChanges( |
47 const tracked_objects::Location& from_here, | 46 const tracked_objects::Location& from_here, |
48 const syncer::SyncChangeList& change_list) override; | 47 const syncer::SyncChangeList& change_list) override; |
49 | 48 |
50 // DeviceInfoTracker implementation. | 49 // DeviceInfoTracker implementation. |
51 bool IsSyncing() const override; | 50 bool IsSyncing() const override; |
52 std::unique_ptr<DeviceInfo> GetDeviceInfo( | 51 std::unique_ptr<DeviceInfo> GetDeviceInfo( |
53 const std::string& client_id) const override; | 52 const std::string& client_id) const override; |
54 ScopedVector<DeviceInfo> GetAllDeviceInfo() const override; | 53 std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const override; |
55 void AddObserver(Observer* observer) override; | 54 void AddObserver(Observer* observer) override; |
56 void RemoveObserver(Observer* observer) override; | 55 void RemoveObserver(Observer* observer) override; |
57 int CountActiveDevices() const override; | 56 int CountActiveDevices() const override; |
58 | 57 |
59 private: | 58 private: |
60 friend class DeviceInfoSyncServiceTest; | 59 friend class DeviceInfoSyncServiceTest; |
61 | 60 |
62 // Create SyncData from local DeviceInfo. | 61 // Create SyncData from local DeviceInfo. |
63 syncer::SyncData CreateLocalData(const DeviceInfo* info); | 62 syncer::SyncData CreateLocalData(const DeviceInfo* info); |
64 // Create SyncData from EntitySpecifics. | 63 // Create SyncData from EntitySpecifics. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 | 101 |
103 // Used to update our local device info once every pulse interval. | 102 // Used to update our local device info once every pulse interval. |
104 base::OneShotTimer pulse_timer_; | 103 base::OneShotTimer pulse_timer_; |
105 | 104 |
106 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncService); | 105 DISALLOW_COPY_AND_ASSIGN(DeviceInfoSyncService); |
107 }; | 106 }; |
108 | 107 |
109 } // namespace sync_driver | 108 } // namespace sync_driver |
110 | 109 |
111 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_SERVICE_H_ | 110 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SYNC_SERVICE_H_ |
OLD | NEW |