| OLD | NEW |
| 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_sync_bridge.h" | 5 #include "components/sync/device_info/device_info_sync_bridge.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <set> | 10 #include <set> |
| 11 #include <utility> | 11 #include <utility> |
| 12 | 12 |
| 13 #include "base/bind.h" | 13 #include "base/bind.h" |
| 14 #include "base/location.h" | 14 #include "base/location.h" |
| 15 #include "base/memory/ptr_util.h" | 15 #include "base/memory/ptr_util.h" |
| 16 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 17 #include "components/sync/base/time.h" | 17 #include "components/sync/base/time.h" |
| 18 #include "components/sync/device_info/device_info_util.h" | 18 #include "components/sync/device_info/device_info_util.h" |
| 19 #include "components/sync/model/entity_change.h" | 19 #include "components/sync/model/entity_change.h" |
| 20 #include "components/sync/model/metadata_batch.h" | 20 #include "components/sync/model/metadata_batch.h" |
| 21 #include "components/sync/model/model_error.h" | |
| 22 #include "components/sync/model/mutable_data_batch.h" | 21 #include "components/sync/model/mutable_data_batch.h" |
| 23 #include "components/sync/protocol/model_type_state.pb.h" | 22 #include "components/sync/protocol/model_type_state.pb.h" |
| 24 #include "components/sync/protocol/sync.pb.h" | 23 #include "components/sync/protocol/sync.pb.h" |
| 25 | 24 |
| 26 namespace syncer { | 25 namespace syncer { |
| 27 | 26 |
| 28 using base::Time; | 27 using base::Time; |
| 29 using base::TimeDelta; | 28 using base::TimeDelta; |
| 30 using sync_pb::DeviceInfoSpecifics; | 29 using sync_pb::DeviceInfoSpecifics; |
| 31 using sync_pb::EntitySpecifics; | 30 using sync_pb::EntitySpecifics; |
| (...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 | 472 |
| 474 int DeviceInfoSyncBridge::CountActiveDevices(const Time now) const { | 473 int DeviceInfoSyncBridge::CountActiveDevices(const Time now) const { |
| 475 return std::count_if(all_data_.begin(), all_data_.end(), | 474 return std::count_if(all_data_.begin(), all_data_.end(), |
| 476 [now](ClientIdToSpecifics::const_reference pair) { | 475 [now](ClientIdToSpecifics::const_reference pair) { |
| 477 return DeviceInfoUtil::IsActive( | 476 return DeviceInfoUtil::IsActive( |
| 478 GetLastUpdateTime(*pair.second), now); | 477 GetLastUpdateTime(*pair.second), now); |
| 479 }); | 478 }); |
| 480 } | 479 } |
| 481 | 480 |
| 482 } // namespace syncer | 481 } // namespace syncer |
| OLD | NEW |