OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/engine_impl/loopback_server/loopback_server.h" | 5 #include "components/sync/engine_impl/loopback_server/loopback_server.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <limits> | 8 #include <limits> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 ModelTypeToVersionMap::const_iterator it = | 94 ModelTypeToVersionMap::const_iterator it = |
95 request_from_version_.find(entity.GetModelType()); | 95 request_from_version_.find(entity.GetModelType()); |
96 | 96 |
97 return it == request_from_version_.end() ? false : it->second < version; | 97 return it == request_from_version_.end() ? false : it->second < version; |
98 } | 98 } |
99 | 99 |
100 // Returns the minimum version seen across all types. | 100 // Returns the minimum version seen across all types. |
101 int64_t GetMinVersion() const { return min_version_; } | 101 int64_t GetMinVersion() const { return min_version_; } |
102 | 102 |
103 private: | 103 private: |
104 typedef std::map<ModelType, int64_t> ModelTypeToVersionMap; | 104 using ModelTypeToVersionMap = std::map<ModelType, int64_t>; |
105 | 105 |
106 // Creates an UpdateSieve. | 106 // Creates an UpdateSieve. |
107 UpdateSieve(const ModelTypeToVersionMap request_from_version, | 107 UpdateSieve(const ModelTypeToVersionMap request_from_version, |
108 const int64_t min_version) | 108 const int64_t min_version) |
109 : request_from_version_(request_from_version), | 109 : request_from_version_(request_from_version), |
110 min_version_(min_version) {} | 110 min_version_(min_version) {} |
111 | 111 |
112 // Maps data type IDs to the latest version seen for that type. | 112 // Maps data type IDs to the latest version seen for that type. |
113 const ModelTypeToVersionMap request_from_version_; | 113 const ModelTypeToVersionMap request_from_version_; |
114 | 114 |
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
547 // write. | 547 // write. |
548 LOG(ERROR) << "Loopback sync can not read the persistent state file."; | 548 LOG(ERROR) << "Loopback sync can not read the persistent state file."; |
549 return false; | 549 return false; |
550 } | 550 } |
551 } | 551 } |
552 LOG(WARNING) << "Loopback sync persistent state file does not exist."; | 552 LOG(WARNING) << "Loopback sync persistent state file does not exist."; |
553 return false; | 553 return false; |
554 } | 554 } |
555 | 555 |
556 } // namespace syncer | 556 } // namespace syncer |
OLD | NEW |