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

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

Issue 2310683002: Remove most ScopedVector usage from c/b/extensions. (Closed)
Patch Set: remove scoped_vector includes Created 4 years, 3 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 #include "components/sync/device_info/device_info_service.h" 5 #include "components/sync/device_info/device_info_service.h"
6 6
7 #include <set> 7 #include <set>
8 #include <utility> 8 #include <utility>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after
223 std::unique_ptr<DeviceInfo> DeviceInfoService::GetDeviceInfo( 223 std::unique_ptr<DeviceInfo> DeviceInfoService::GetDeviceInfo(
224 const std::string& client_id) const { 224 const std::string& client_id) const {
225 const ClientIdToSpecifics::const_iterator iter = all_data_.find(client_id); 225 const ClientIdToSpecifics::const_iterator iter = all_data_.find(client_id);
226 if (iter == all_data_.end()) { 226 if (iter == all_data_.end()) {
227 return std::unique_ptr<DeviceInfo>(); 227 return std::unique_ptr<DeviceInfo>();
228 } 228 }
229 229
230 return CopyToModel(*iter->second); 230 return CopyToModel(*iter->second);
231 } 231 }
232 232
233 ScopedVector<DeviceInfo> DeviceInfoService::GetAllDeviceInfo() const { 233 std::vector<std::unique_ptr<DeviceInfo>> DeviceInfoService::GetAllDeviceInfo()
234 ScopedVector<DeviceInfo> list; 234 const {
235 std::vector<std::unique_ptr<DeviceInfo>> list;
235 236
236 for (ClientIdToSpecifics::const_iterator iter = all_data_.begin(); 237 for (ClientIdToSpecifics::const_iterator iter = all_data_.begin();
237 iter != all_data_.end(); ++iter) { 238 iter != all_data_.end(); ++iter) {
238 list.push_back(CopyToModel(*iter->second)); 239 list.push_back(CopyToModel(*iter->second));
239 } 240 }
240 241
241 return list; 242 return list;
242 } 243 }
243 244
244 void DeviceInfoService::AddObserver(Observer* observer) { 245 void DeviceInfoService::AddObserver(Observer* observer) {
(...skipping 283 matching lines...) Expand 10 before | Expand all | Expand 10 after
528 Time DeviceInfoService::GetLastUpdateTime( 529 Time DeviceInfoService::GetLastUpdateTime(
529 const DeviceInfoSpecifics& specifics) { 530 const DeviceInfoSpecifics& specifics) {
530 if (specifics.has_last_updated_timestamp()) { 531 if (specifics.has_last_updated_timestamp()) {
531 return syncer::ProtoTimeToTime(specifics.last_updated_timestamp()); 532 return syncer::ProtoTimeToTime(specifics.last_updated_timestamp());
532 } else { 533 } else {
533 return Time(); 534 return Time();
534 } 535 }
535 } 536 }
536 537
537 } // namespace sync_driver_v2 538 } // namespace sync_driver_v2
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_service.h ('k') | components/sync/device_info/device_info_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698