Ankush Singh | ee2362f | 2023-08-29 09:42:03 | [diff] [blame] | 1 | // Copyright 2023 The Chromium Authors |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "components/sync/service/local_data_description.h" |
| 6 | |
| 7 | namespace syncer { |
| 8 | |
| 9 | LocalDataDescription::LocalDataDescription() = default; |
| 10 | |
Ankush Singh | 15b04fc | 2023-08-31 13:52:00 | [diff] [blame] | 11 | LocalDataDescription::LocalDataDescription( |
| 12 | ModelType type, |
Ankush Singh | 7e8d605 | 2023-09-04 09:59:41 | [diff] [blame] | 13 | int item_count, |
| 14 | const std::vector<std::string>& domains, |
| 15 | int domain_count) |
| 16 | : type(type), |
| 17 | item_count(item_count), |
| 18 | domains(domains), |
| 19 | domain_count(domain_count) {} |
Ankush Singh | 15b04fc | 2023-08-31 13:52:00 | [diff] [blame] | 20 | |
Ankush Singh | ee2362f | 2023-08-29 09:42:03 | [diff] [blame] | 21 | LocalDataDescription::LocalDataDescription(const LocalDataDescription&) = |
| 22 | default; |
| 23 | |
| 24 | LocalDataDescription& LocalDataDescription::operator=( |
| 25 | const LocalDataDescription&) = default; |
| 26 | |
| 27 | LocalDataDescription::LocalDataDescription(LocalDataDescription&&) = default; |
| 28 | |
| 29 | LocalDataDescription& LocalDataDescription::operator=(LocalDataDescription&&) = |
| 30 | default; |
| 31 | |
| 32 | LocalDataDescription::~LocalDataDescription() = default; |
| 33 | |
Ankush Singh | fcbd6b1 | 2023-09-08 11:10:11 | [diff] [blame] | 34 | bool operator==(const LocalDataDescription& lhs, |
| 35 | const LocalDataDescription& rhs) { |
| 36 | return lhs.type == rhs.type && lhs.item_count == rhs.item_count && |
| 37 | lhs.domains == rhs.domains && lhs.domain_count == rhs.domain_count; |
| 38 | } |
| 39 | |
| 40 | bool operator!=(const LocalDataDescription& lhs, |
| 41 | const LocalDataDescription& rhs) { |
| 42 | return !(lhs == rhs); |
| 43 | } |
| 44 | |
Ankush Singh | 05d8b39e | 2023-09-08 13:13:35 | [diff] [blame^] | 45 | void PrintTo(const LocalDataDescription& desc, std::ostream* os) { |
| 46 | *os << "{ type:" << syncer::ModelTypeToDebugString(desc.type) |
| 47 | << ", item_count:" << desc.item_count << ", domains:["; |
| 48 | for (const auto& domain : desc.domains) { |
| 49 | *os << domain << ","; |
| 50 | } |
| 51 | *os << "], domain_count:" << desc.domain_count; |
| 52 | } |
| 53 | |
Ankush Singh | ee2362f | 2023-08-29 09:42:03 | [diff] [blame] | 54 | } // namespace syncer |