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

Unified Diff: content/browser/download/download_item_impl.h

Issue 2689373003: Introduce ParallelDownloadJob. (Closed)
Patch Set: Polish some details. 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/browser/download/download_item_impl.h
diff --git a/content/browser/download/download_item_impl.h b/content/browser/download/download_item_impl.h
index c899f25016b113ef24356a9f5cb565b2d8be20e4..5242565384465ffa2e843084a7cc66942cd8bebd 100644
--- a/content/browser/download/download_item_impl.h
+++ b/content/browser/download/download_item_impl.h
@@ -28,6 +28,7 @@
namespace content {
class DownloadFile;
class DownloadItemImplDelegate;
+class DownloadJob;
// See download_item.h for usage.
class CONTENT_EXPORT DownloadItemImpl
@@ -228,6 +229,8 @@ class CONTENT_EXPORT DownloadItemImpl
std::unique_ptr<crypto::SecureHash> hash_state) override;
private:
+ friend class DownloadJob;
+
// Fine grained states of a download.
//
// New downloads can be created in the following states:
@@ -391,6 +394,9 @@ class CONTENT_EXPORT DownloadItemImpl
// this is.
void Init(bool active, DownloadType download_type);
+ // Start a series of events that result in the file being downloaded.
+ void StartDownloadProgress();
+
// Callback from file thread when we initialize the DownloadFile.
void OnDownloadFileInitialized(DownloadInterruptReason result);
@@ -501,10 +507,6 @@ class CONTENT_EXPORT DownloadItemImpl
// TODO(rdsmith): Replace with a generalized enum for "download source".
const bool is_save_package_download_ = false;
- // The handle to the request information. Used for operations outside the
- // download system.
- std::unique_ptr<DownloadRequestHandleInterface> request_handle_;
-
std::string guid_;
uint32_t download_id_ = kInvalidId;
@@ -594,9 +596,6 @@ class CONTENT_EXPORT DownloadItemImpl
// Our delegate.
DownloadItemImplDelegate* delegate_ = nullptr;
- // In progress downloads may be paused by the user, we note it here.
- bool is_paused_ = false;
-
// A flag for indicating if the download should be opened at completion.
bool open_when_complete_ = false;
@@ -677,6 +676,8 @@ class CONTENT_EXPORT DownloadItemImpl
// Net log to use for this download.
const net::NetLogWithSource net_log_;
+ std::unique_ptr<DownloadJob> job_;
+
base::WeakPtrFactory<DownloadItemImpl> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(DownloadItemImpl);

Powered by Google App Engine
This is Rietveld 408576698