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

Side by Side Diff: components/sync_driver/device_info_service.h

Issue 1763953002: [USS] Change the place where SharedModelTypeProcessor got created (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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_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 <stdint.h> 8 #include <stdint.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 28 matching lines...) Expand all
39 // device info and associated sync metadata, applying/merging foreign changes, 39 // device info and associated sync metadata, applying/merging foreign changes,
40 // and allows public read access. 40 // and allows public read access.
41 class DeviceInfoService : public syncer_v2::ModelTypeService, 41 class DeviceInfoService : public syncer_v2::ModelTypeService,
42 public sync_driver::DeviceInfoTracker { 42 public sync_driver::DeviceInfoTracker {
43 public: 43 public:
44 typedef base::Callback<void(syncer_v2::ModelTypeStore::InitCallback callback)> 44 typedef base::Callback<void(syncer_v2::ModelTypeStore::InitCallback callback)>
45 StoreFactoryFunction; 45 StoreFactoryFunction;
46 46
47 DeviceInfoService( 47 DeviceInfoService(
48 sync_driver::LocalDeviceInfoProvider* local_device_info_provider, 48 sync_driver::LocalDeviceInfoProvider* local_device_info_provider,
49 const StoreFactoryFunction& callback); 49 const StoreFactoryFunction& callback,
50 const SharedProcessorFactory& shared_processor_factory);
50 ~DeviceInfoService() override; 51 ~DeviceInfoService() override;
51 52
52 // ModelTypeService implementation. 53 // ModelTypeService implementation.
53 scoped_ptr<syncer_v2::MetadataChangeList> CreateMetadataChangeList() override; 54 scoped_ptr<syncer_v2::MetadataChangeList> CreateMetadataChangeList() override;
54 syncer::SyncError MergeSyncData( 55 syncer::SyncError MergeSyncData(
55 scoped_ptr<syncer_v2::MetadataChangeList> metadata_change_list, 56 scoped_ptr<syncer_v2::MetadataChangeList> metadata_change_list,
56 syncer_v2::EntityDataMap entity_data_map) override; 57 syncer_v2::EntityDataMap entity_data_map) override;
57 syncer::SyncError ApplySyncChanges( 58 syncer::SyncError ApplySyncChanges(
58 scoped_ptr<syncer_v2::MetadataChangeList> metadata_change_list, 59 scoped_ptr<syncer_v2::MetadataChangeList> metadata_change_list,
59 syncer_v2::EntityChangeList entity_changes) override; 60 syncer_v2::EntityChangeList entity_changes) override;
60 void GetData(ClientTagList client_tags, DataCallback callback) override; 61 void GetData(ClientTagList client_tags, DataCallback callback) override;
61 void GetAllData(DataCallback callback) override; 62 void GetAllData(DataCallback callback) override;
62 std::string GetClientTag(const syncer_v2::EntityData& entity_data) override; 63 std::string GetClientTag(const syncer_v2::EntityData& entity_data) override;
63 void OnChangeProcessorSet() override; 64 void OnChangeProcessorSet() override;
64 65
65 // DeviceInfoTracker implementation. 66 // DeviceInfoTracker implementation.
66 bool IsSyncing() const override; 67 bool IsSyncing() const override;
67 scoped_ptr<sync_driver::DeviceInfo> GetDeviceInfo( 68 scoped_ptr<sync_driver::DeviceInfo> GetDeviceInfo(
68 const std::string& client_id) const override; 69 const std::string& client_id) const override;
69 ScopedVector<sync_driver::DeviceInfo> GetAllDeviceInfo() const override; 70 ScopedVector<sync_driver::DeviceInfo> GetAllDeviceInfo() const override;
70 void AddObserver(Observer* observer) override; 71 void AddObserver(Observer* observer) override;
71 void RemoveObserver(Observer* observer) override; 72 void RemoveObserver(Observer* observer) override;
72 int CountActiveDevices() const override; 73 int CountActiveDevices() const override;
74 syncer::ModelType type() const override;
skym 2016/03/22 15:56:26 You added this to the DeviceInfoTracker methods, w
73 75
74 private: 76 private:
75 friend class DeviceInfoServiceTest; 77 friend class DeviceInfoServiceTest;
76 78
77 scoped_ptr<sync_pb::DeviceInfoSpecifics> CreateLocalSpecifics(); 79 scoped_ptr<sync_pb::DeviceInfoSpecifics> CreateLocalSpecifics();
78 static scoped_ptr<sync_pb::DeviceInfoSpecifics> CreateSpecifics( 80 static scoped_ptr<sync_pb::DeviceInfoSpecifics> CreateSpecifics(
79 const sync_driver::DeviceInfo& info); 81 const sync_driver::DeviceInfo& info);
80 82
81 // Allocate new DeviceInfo from SyncData. 83 // Allocate new DeviceInfo from SyncData.
82 static scoped_ptr<sync_driver::DeviceInfo> CreateDeviceInfo( 84 static scoped_ptr<sync_driver::DeviceInfo> CreateDeviceInfo(
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 148
147 // Should always be last member. 149 // Should always be last member.
148 base::WeakPtrFactory<DeviceInfoService> weak_factory_; 150 base::WeakPtrFactory<DeviceInfoService> weak_factory_;
149 151
150 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); 152 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService);
151 }; 153 };
152 154
153 } // namespace sync_driver_v2 155 } // namespace sync_driver_v2
154 156
155 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ 157 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698