Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(144)

Side by Side Diff: components/sync/device_info/device_info_service.h

Issue 2406163006: [Sync] Services can now always assume processor exists. (Closed)
Patch Set: Updates for Max. Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 SyncError MergeSyncData( 55 SyncError MergeSyncData(
56 std::unique_ptr<MetadataChangeList> metadata_change_list, 56 std::unique_ptr<MetadataChangeList> metadata_change_list,
57 EntityDataMap entity_data_map) override; 57 EntityDataMap entity_data_map) override;
58 SyncError ApplySyncChanges( 58 SyncError ApplySyncChanges(
59 std::unique_ptr<MetadataChangeList> metadata_change_list, 59 std::unique_ptr<MetadataChangeList> metadata_change_list,
60 EntityChangeList entity_changes) override; 60 EntityChangeList entity_changes) override;
61 void GetData(StorageKeyList storage_keys, DataCallback callback) override; 61 void GetData(StorageKeyList storage_keys, DataCallback callback) override;
62 void GetAllData(DataCallback callback) override; 62 void GetAllData(DataCallback callback) override;
63 std::string GetClientTag(const EntityData& entity_data) override; 63 std::string GetClientTag(const EntityData& entity_data) override;
64 std::string GetStorageKey(const EntityData& entity_data) override; 64 std::string GetStorageKey(const EntityData& entity_data) override;
65 void OnChangeProcessorSet() override;
66 65
67 // DeviceInfoTracker implementation. 66 // DeviceInfoTracker implementation.
68 bool IsSyncing() const override; 67 bool IsSyncing() const override;
69 std::unique_ptr<DeviceInfo> GetDeviceInfo( 68 std::unique_ptr<DeviceInfo> GetDeviceInfo(
70 const std::string& client_id) const override; 69 const std::string& client_id) const override;
71 std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const override; 70 std::vector<std::unique_ptr<DeviceInfo>> GetAllDeviceInfo() const override;
72 void AddObserver(Observer* observer) override; 71 void AddObserver(Observer* observer) override;
73 void RemoveObserver(Observer* observer) override; 72 void RemoveObserver(Observer* observer) override;
74 int CountActiveDevices() const override; 73 int CountActiveDevices() const override;
75 74
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // initialized during our constructor then the subscription is never used. 159 // initialized during our constructor then the subscription is never used.
161 std::unique_ptr<LocalDeviceInfoProvider::Subscription> subscription_; 160 std::unique_ptr<LocalDeviceInfoProvider::Subscription> subscription_;
162 161
163 // In charge of actually persiting changes to disk, or loading previous data. 162 // In charge of actually persiting changes to disk, or loading previous data.
164 std::unique_ptr<ModelTypeStore> store_; 163 std::unique_ptr<ModelTypeStore> store_;
165 164
166 // If |local_device_info_provider_| has initialized. 165 // If |local_device_info_provider_| has initialized.
167 bool has_provider_initialized_ = false; 166 bool has_provider_initialized_ = false;
168 // If data has been loaded from the store. 167 // If data has been loaded from the store.
169 bool has_data_loaded_ = false; 168 bool has_data_loaded_ = false;
170 // if |change_processor()| has been given metadata.
171 bool has_metadata_loaded_ = false;
172 169
173 // Used to update our local device info once every pulse interval. 170 // Used to update our local device info once every pulse interval.
174 base::OneShotTimer pulse_timer_; 171 base::OneShotTimer pulse_timer_;
175 172
176 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); 173 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService);
177 }; 174 };
178 175
179 } // namespace syncer 176 } // namespace syncer
180 177
181 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_ 178 #endif // COMPONENTS_SYNC_DEVICE_INFO_DEVICE_INFO_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/sync/test/integration/two_client_uss_sync_test.cc ('k') | components/sync/device_info/device_info_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698