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

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

Issue 1888923003: [Sync] DeviceInfoService should format ClientTag in backwards compatible way (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address Sky's and Max's comments. Created 4 years, 8 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
« no previous file with comments | « no previous file | components/sync_driver/device_info_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 scoped_ptr<sync_driver::DeviceInfo> GetDeviceInfo( 69 scoped_ptr<sync_driver::DeviceInfo> GetDeviceInfo(
70 const std::string& client_id) const override; 70 const std::string& client_id) const override;
71 ScopedVector<sync_driver::DeviceInfo> GetAllDeviceInfo() const override; 71 ScopedVector<sync_driver::DeviceInfo> GetAllDeviceInfo() const override;
72 void AddObserver(Observer* observer) override; 72 void AddObserver(Observer* observer) override;
73 void RemoveObserver(Observer* observer) override; 73 void RemoveObserver(Observer* observer) override;
74 int CountActiveDevices() const override; 74 int CountActiveDevices() const override;
75 75
76 private: 76 private:
77 friend class DeviceInfoServiceTest; 77 friend class DeviceInfoServiceTest;
78 78
79 // Formats ClientTag form DeviceInfoSpecifics.
80 static std::string SpecificsToTag(
81 const sync_pb::DeviceInfoSpecifics& specifics);
82
83 // Extracts cache_guid from ClientTag.
84 static std::string TagToCacheGuid(const std::string& tag);
85
79 static scoped_ptr<sync_pb::DeviceInfoSpecifics> CopyToSpecifics( 86 static scoped_ptr<sync_pb::DeviceInfoSpecifics> CopyToSpecifics(
80 const sync_driver::DeviceInfo& info); 87 const sync_driver::DeviceInfo& info);
81 88
82 // Allocate new DeviceInfo from SyncData. 89 // Allocate new DeviceInfo from SyncData.
83 static scoped_ptr<sync_driver::DeviceInfo> CopyToModel( 90 static scoped_ptr<sync_driver::DeviceInfo> CopyToModel(
84 const sync_pb::DeviceInfoSpecifics& specifics); 91 const sync_pb::DeviceInfoSpecifics& specifics);
85 // Conversion as we prepare to hand data to the processor. 92 // Conversion as we prepare to hand data to the processor.
86 static scoped_ptr<syncer_v2::EntityData> CopyToEntityData( 93 static scoped_ptr<syncer_v2::EntityData> CopyToEntityData(
87 const sync_pb::DeviceInfoSpecifics& specifics); 94 const sync_pb::DeviceInfoSpecifics& specifics);
88 95
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 160
154 // Should always be last member. 161 // Should always be last member.
155 base::WeakPtrFactory<DeviceInfoService> weak_factory_; 162 base::WeakPtrFactory<DeviceInfoService> weak_factory_;
156 163
157 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService); 164 DISALLOW_COPY_AND_ASSIGN(DeviceInfoService);
158 }; 165 };
159 166
160 } // namespace sync_driver_v2 167 } // namespace sync_driver_v2
161 168
162 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_ 169 #endif // COMPONENTS_SYNC_DRIVER_DEVICE_INFO_SERVICE_H_
OLDNEW
« no previous file with comments | « no previous file | components/sync_driver/device_info_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698