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_DRIVER_DEVICE_INFO_SERVICE_H_ | 5 #ifndef COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ |
6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ | 6 #define COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ |
7 | 7 |
| 8 #include <map> |
8 #include <string> | 9 #include <string> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/containers/scoped_ptr_map.h" | |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/observer_list.h" | 14 #include "base/observer_list.h" |
15 #include "components/sync_driver/device_info_tracker.h" | 15 #include "components/sync_driver/device_info_tracker.h" |
16 #include "components/sync_driver/local_device_info_provider.h" | 16 #include "components/sync_driver/local_device_info_provider.h" |
17 #include "sync/api/model_type_service.h" | 17 #include "sync/api/model_type_service.h" |
18 | 18 |
19 namespace syncer { | 19 namespace syncer { |
20 class SyncError; | 20 class SyncError; |
21 } // namespace syncer | 21 } // namespace syncer |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 // TODO(skym): Remove once we remove local provider. | 100 // TODO(skym): Remove once we remove local provider. |
101 // Local device last set backup time (in proto format). | 101 // Local device last set backup time (in proto format). |
102 // -1 if the value hasn't been specified | 102 // -1 if the value hasn't been specified |
103 int64 local_device_backup_time_; | 103 int64 local_device_backup_time_; |
104 | 104 |
105 // |local_device_info_provider_| isn't owned. | 105 // |local_device_info_provider_| isn't owned. |
106 const sync_driver::LocalDeviceInfoProvider* const local_device_info_provider_; | 106 const sync_driver::LocalDeviceInfoProvider* const local_device_info_provider_; |
107 | 107 |
108 // TODO(skym): Switch to use client tag hash instead of cache guid as key. | 108 // TODO(skym): Switch to use client tag hash instead of cache guid as key. |
109 // Cache of all syncable and local data, stored by device cache guid. | 109 // Cache of all syncable and local data, stored by device cache guid. |
110 typedef base::ScopedPtrMap<std::string, | 110 using ClientIdToSpecifics = |
111 scoped_ptr<sync_pb::DeviceInfoSpecifics>> | 111 std::map<std::string, scoped_ptr<sync_pb::DeviceInfoSpecifics>>; |
112 ClientIdToSpecifics; | |
113 ClientIdToSpecifics all_data_; | 112 ClientIdToSpecifics all_data_; |
114 | 113 |
115 // Registered observers, not owned. | 114 // Registered observers, not owned. |
116 base::ObserverList<Observer, true> observers_; | 115 base::ObserverList<Observer, true> observers_; |
117 | 116 |
118 scoped_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> subscription_; | 117 scoped_ptr<sync_driver::LocalDeviceInfoProvider::Subscription> subscription_; |
119 | 118 |
120 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); | 119 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); |
121 }; | 120 }; |
122 | 121 |
123 } // namespace sync_driver_v2 | 122 } // namespace sync_driver_v2 |
124 | 123 |
125 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ | 124 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ |
OLD | NEW |