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

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

Issue 2424673002: Remove usage of FOR_EACH_OBSERVER macro in components/sync (Closed)
Patch Set: blank line before return 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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_sync_service.h" 5 #include "components/sync/device_info/device_info_sync_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <utility> 10 #include <utility>
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
217 217
218 void DeviceInfoSyncService::RemoveObserver(Observer* observer) { 218 void DeviceInfoSyncService::RemoveObserver(Observer* observer) {
219 observers_.RemoveObserver(observer); 219 observers_.RemoveObserver(observer);
220 } 220 }
221 221
222 int DeviceInfoSyncService::CountActiveDevices() const { 222 int DeviceInfoSyncService::CountActiveDevices() const {
223 return CountActiveDevices(Time::Now()); 223 return CountActiveDevices(Time::Now());
224 } 224 }
225 225
226 void DeviceInfoSyncService::NotifyObservers() { 226 void DeviceInfoSyncService::NotifyObservers() {
227 FOR_EACH_OBSERVER(Observer, observers_, OnDeviceInfoChange()); 227 for (auto& observer : observers_)
228 observer.OnDeviceInfoChange();
228 } 229 }
229 230
230 SyncData DeviceInfoSyncService::CreateLocalData(const DeviceInfo* info) { 231 SyncData DeviceInfoSyncService::CreateLocalData(const DeviceInfo* info) {
231 sync_pb::EntitySpecifics entity; 232 sync_pb::EntitySpecifics entity;
232 sync_pb::DeviceInfoSpecifics& specifics = *entity.mutable_device_info(); 233 sync_pb::DeviceInfoSpecifics& specifics = *entity.mutable_device_info();
233 234
234 specifics.set_cache_guid(info->guid()); 235 specifics.set_cache_guid(info->guid());
235 specifics.set_client_name(info->client_name()); 236 specifics.set_client_name(info->client_name());
236 specifics.set_chrome_version(info->chrome_version()); 237 specifics.set_chrome_version(info->chrome_version());
237 specifics.set_sync_user_agent(info->sync_user_agent()); 238 specifics.set_sync_user_agent(info->sync_user_agent());
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
315 return SyncDataRemote(device_info).GetModifiedTime(); 316 return SyncDataRemote(device_info).GetModifiedTime();
316 } else { 317 } else {
317 // We shouldn't reach this point for remote data, so this means we're likely 318 // We shouldn't reach this point for remote data, so this means we're likely
318 // looking at the local device info. Using a long ago time is perfect, since 319 // looking at the local device info. Using a long ago time is perfect, since
319 // the desired behavior is to update/pulse our data as soon as possible. 320 // the desired behavior is to update/pulse our data as soon as possible.
320 return Time(); 321 return Time();
321 } 322 }
322 } 323 }
323 324
324 } // namespace syncer 325 } // namespace syncer
OLDNEW
« no previous file with comments | « components/sync/device_info/device_info_service.cc ('k') | components/sync/driver/backend_migrator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698