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

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

Issue 2689373003: Introduce ParallelDownloadJob. (Closed)
Patch Set: Make windows compiler happy. 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..b82fa4a4be4e7b04d220ceefacb84c6ceb641857 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,10 @@ class CONTENT_EXPORT DownloadItemImpl
// this is.
void Init(bool active, DownloadType download_type);
+ // Initialize download file, this will create the byte stream on file
+ // thread.
+ void InitializeDownloadFile();
+
// Callback from file thread when we initialize the DownloadFile.
void OnDownloadFileInitialized(DownloadInterruptReason result);
@@ -501,10 +508,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;
@@ -677,6 +680,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