| OLD | NEW |
| 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 28 matching lines...) Expand all Loading... |
| 39 | 39 |
| 40 DCHECK(!IsSyncing()); | 40 DCHECK(!IsSyncing()); |
| 41 | 41 |
| 42 sync_processor_ = std::move(sync_processor); | 42 sync_processor_ = std::move(sync_processor); |
| 43 error_handler_ = std::move(error_handler); | 43 error_handler_ = std::move(error_handler); |
| 44 | 44 |
| 45 // Initialization should be completed before this type is enabled | 45 // Initialization should be completed before this type is enabled |
| 46 // and local device info must be available. | 46 // and local device info must be available. |
| 47 const DeviceInfo* local_device_info = | 47 const DeviceInfo* local_device_info = |
| 48 local_device_info_provider_->GetLocalDeviceInfo(); | 48 local_device_info_provider_->GetLocalDeviceInfo(); |
| 49 DCHECK(local_device_info != NULL); | 49 DCHECK(local_device_info != nullptr); |
| 50 | 50 |
| 51 // Indicates whether a local device has been added or updated. | 51 // Indicates whether a local device has been added or updated. |
| 52 // |change_type| defaults to ADD and might be changed to | 52 // |change_type| defaults to ADD and might be changed to |
| 53 // UPDATE to INVALID down below if the initial data contains | 53 // UPDATE to INVALID down below if the initial data contains |
| 54 // data matching the local device ID. | 54 // data matching the local device ID. |
| 55 SyncChange::SyncChangeType change_type = SyncChange::ACTION_ADD; | 55 SyncChange::SyncChangeType change_type = SyncChange::ACTION_ADD; |
| 56 TimeDelta pulse_delay; | 56 TimeDelta pulse_delay; |
| 57 size_t num_items_new = 0; | 57 size_t num_items_new = 0; |
| 58 size_t num_items_updated = 0; | 58 size_t num_items_updated = 0; |
| 59 | 59 |
| (...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 return SyncDataRemote(device_info).GetModifiedTime(); | 315 return SyncDataRemote(device_info).GetModifiedTime(); |
| 316 } else { | 316 } else { |
| 317 // We shouldn't reach this point for remote data, so this means we're likely | 317 // 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 | 318 // 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. | 319 // the desired behavior is to update/pulse our data as soon as possible. |
| 320 return Time(); | 320 return Time(); |
| 321 } | 321 } |
| 322 } | 322 } |
| 323 | 323 |
| 324 } // namespace syncer | 324 } // namespace syncer |
| OLD | NEW |