| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/offline_items_collection/core/offline_item.h" | 5 #include "components/offline_items_collection/core/offline_item.h" |
| 6 | 6 |
| 7 namespace offline_items_collection { | 7 namespace offline_items_collection { |
| 8 | 8 |
| 9 ContentId::ContentId() = default; | 9 ContentId::ContentId() = default; |
| 10 | 10 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 return name_space == content_id.name_space && id == content_id.id; | 21 return name_space == content_id.name_space && id == content_id.id; |
| 22 } | 22 } |
| 23 | 23 |
| 24 bool ContentId::operator<(const ContentId& content_id) const { | 24 bool ContentId::operator<(const ContentId& content_id) const { |
| 25 return std::tie(name_space, id) < | 25 return std::tie(name_space, id) < |
| 26 std::tie(content_id.name_space, content_id.id); | 26 std::tie(content_id.name_space, content_id.id); |
| 27 } | 27 } |
| 28 | 28 |
| 29 OfflineItem::OfflineItem() | 29 OfflineItem::OfflineItem() |
| 30 : filter(OfflineItemFilter::FILTER_OTHER), | 30 : filter(OfflineItemFilter::FILTER_OTHER), |
| 31 is_transient(false), |
| 31 total_size_bytes(0), | 32 total_size_bytes(0), |
| 32 externally_removed(false), | 33 externally_removed(false), |
| 34 is_openable(false), |
| 33 is_off_the_record(false), | 35 is_off_the_record(false), |
| 34 state(OfflineItemState::COMPLETE), | 36 state(OfflineItemState::COMPLETE), |
| 35 is_resumable(false), | 37 is_resumable(false), |
| 38 allow_metered(false), |
| 36 received_bytes(0), | 39 received_bytes(0), |
| 37 percent_completed(0), | 40 percent_completed(0), |
| 38 time_remaining_ms(0) {} | 41 time_remaining_ms(0) {} |
| 39 | 42 |
| 40 OfflineItem::OfflineItem(const OfflineItem& other) = default; | 43 OfflineItem::OfflineItem(const OfflineItem& other) = default; |
| 41 | 44 |
| 42 OfflineItem::OfflineItem(const ContentId& id) : OfflineItem() { | 45 OfflineItem::OfflineItem(const ContentId& id) : OfflineItem() { |
| 43 this->id = id; | 46 this->id = id; |
| 44 } | 47 } |
| 45 | 48 |
| 46 OfflineItem::~OfflineItem() = default; | 49 OfflineItem::~OfflineItem() = default; |
| 47 | 50 |
| 48 bool OfflineItem::operator==(const OfflineItem& offline_item) const { | 51 bool OfflineItem::operator==(const OfflineItem& offline_item) const { |
| 49 return id == offline_item.id && title == offline_item.title && | 52 return id == offline_item.id && title == offline_item.title && |
| 50 description == offline_item.description && | 53 description == offline_item.description && |
| 51 filter == offline_item.filter && | 54 filter == offline_item.filter && |
| 55 is_transient == offline_item.is_transient && |
| 52 total_size_bytes == offline_item.total_size_bytes && | 56 total_size_bytes == offline_item.total_size_bytes && |
| 53 externally_removed == offline_item.externally_removed && | 57 externally_removed == offline_item.externally_removed && |
| 54 creation_time == offline_item.creation_time && | 58 creation_time == offline_item.creation_time && |
| 55 last_accessed_time == offline_item.last_accessed_time && | 59 last_accessed_time == offline_item.last_accessed_time && |
| 60 is_openable == offline_item.is_openable && |
| 56 page_url == offline_item.page_url && | 61 page_url == offline_item.page_url && |
| 57 original_url == offline_item.original_url && | 62 original_url == offline_item.original_url && |
| 58 is_off_the_record == offline_item.is_off_the_record && | 63 is_off_the_record == offline_item.is_off_the_record && |
| 59 state == offline_item.state && | 64 state == offline_item.state && |
| 60 is_resumable == offline_item.is_resumable && | 65 is_resumable == offline_item.is_resumable && |
| 66 allow_metered == offline_item.allow_metered && |
| 61 received_bytes == offline_item.received_bytes && | 67 received_bytes == offline_item.received_bytes && |
| 62 percent_completed == offline_item.percent_completed && | 68 percent_completed == offline_item.percent_completed && |
| 63 time_remaining_ms == offline_item.time_remaining_ms; | 69 time_remaining_ms == offline_item.time_remaining_ms; |
| 64 } | 70 } |
| 65 | 71 |
| 66 } // namespace offline_items_collection | 72 } // namespace offline_items_collection |
| OLD | NEW |