Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(343)

Unified Diff: components/offline_items_collection/core/offline_item.cc

Issue 2861863002: offline_items_collection : Added helper class to determine progress (Closed)
Patch Set: comments Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/offline_items_collection/core/offline_item.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/offline_items_collection/core/offline_item.cc
diff --git a/components/offline_items_collection/core/offline_item.cc b/components/offline_items_collection/core/offline_item.cc
index 834938dc63ed2b2e56944721bce2ca757d6ae4cf..762a17fa95d632f2bd9b2315a7db59028228f4d3 100644
--- a/components/offline_items_collection/core/offline_item.cc
+++ b/components/offline_items_collection/core/offline_item.cc
@@ -26,6 +26,18 @@ bool ContentId::operator<(const ContentId& content_id) const {
std::tie(content_id.name_space, content_id.id);
}
+OfflineItem::Progress::Progress()
+ : value(0), unit(OfflineItemProgressUnit::BYTES) {}
+
+OfflineItem::Progress::Progress(const OfflineItem::Progress& other) = default;
+
+OfflineItem::Progress::~Progress() = default;
+
+bool OfflineItem::Progress::operator==(
+ const OfflineItem::Progress& other) const {
+ return value == other.value && max == other.max && unit == other.unit;
+}
+
OfflineItem::OfflineItem()
: filter(OfflineItemFilter::FILTER_OTHER),
is_transient(false),
@@ -37,7 +49,6 @@ OfflineItem::OfflineItem()
is_resumable(false),
allow_metered(false),
received_bytes(0),
- percent_completed(0),
time_remaining_ms(0) {}
OfflineItem::OfflineItem(const OfflineItem& other) = default;
@@ -65,7 +76,7 @@ bool OfflineItem::operator==(const OfflineItem& offline_item) const {
is_resumable == offline_item.is_resumable &&
allow_metered == offline_item.allow_metered &&
received_bytes == offline_item.received_bytes &&
- percent_completed == offline_item.percent_completed &&
+ progress == offline_item.progress &&
time_remaining_ms == offline_item.time_remaining_ms;
}
« no previous file with comments | « components/offline_items_collection/core/offline_item.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698