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

Unified Diff: content/public/browser/download_item.h

Issue 2703883003: Read and restore persisted slice info (Closed)
Patch Set: Created 3 years, 10 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
Index: content/public/browser/download_item.h
diff --git a/content/public/browser/download_item.h b/content/public/browser/download_item.h
index 32963bfd476415a5b22a75857900d68b462c7527..e6a2656eadc968557099b5330fe3fb21025aa8f2 100644
--- a/content/public/browser/download_item.h
+++ b/content/public/browser/download_item.h
@@ -102,6 +102,18 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
virtual ~Observer() {}
};
+ struct CONTENT_EXPORT ReceivedSlice {
+ ReceivedSlice(int64_t offset, int64_t received_bytes)
+ : offset(offset), received_bytes(received_bytes) {}
+
+ bool operator==(const ReceivedSlice& rhs) const {
+ return offset == rhs.offset && received_bytes == rhs.received_bytes;
+ }
+
+ int64_t offset;
+ int64_t received_bytes;
+ };
+
~DownloadItem() override {}
// Observation ---------------------------------------------------------------
@@ -349,6 +361,10 @@ class CONTENT_EXPORT DownloadItem : public base::SupportsUserData {
// file.
virtual int64_t GetReceivedBytes() const = 0;
+ // Return the slices that have been received so far. This is only used
+ // when parallel downloading is enabled.
+ virtual const std::vector<ReceivedSlice>& GetReceivedSlices() const = 0;
+
// Time the download was first started. This timestamp is always valid and
// doesn't change.
virtual base::Time GetStartTime() const = 0;
« no previous file with comments | « content/browser/download/download_manager_impl_unittest.cc ('k') | content/public/browser/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698