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

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

Issue 2767593003: Handle early pause, cancel for parallel requests. (Closed)
Patch Set: Work on feedback. Created 3 years, 9 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_job.h
diff --git a/content/browser/download/download_job.h b/content/browser/download/download_job.h
index bd101c618d961c7213c4c4a1550e8261de4a434f..5bd4f7e1491f449273d0d9d93e397970bdb2a77a 100644
--- a/content/browser/download/download_job.h
+++ b/content/browser/download/download_job.h
@@ -27,11 +27,12 @@ class CONTENT_EXPORT DownloadJob {
// Download operations.
virtual void Start() = 0;
- virtual void Cancel(bool user_cancel) = 0;
+ virtual void Cancel(bool user_cancel);
virtual void Pause();
virtual void Resume(bool resume_request);
bool is_paused() const { return is_paused_; }
+ bool is_canceled() const { return is_canceled_; }
// Return the WebContents associated with the download. Usually used to
// associate a browser window for any UI that needs to be displayed to the
@@ -44,8 +45,9 @@ class CONTENT_EXPORT DownloadJob {
void StartDownload() const;
void Interrupt(DownloadInterruptReason reason);
- // Add a byte stream to the download sink.
- void AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
+ // Add a byte stream to the download sink. Return false if we start to
+ // destroy download file.
+ bool AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
int64_t offset,
int64_t length);
@@ -55,6 +57,9 @@ class CONTENT_EXPORT DownloadJob {
// If the download progress is paused by the user.
bool is_paused_;
+ // If the download progress is canceled.
+ bool is_canceled_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadJob);
};
« no previous file with comments | « no previous file | content/browser/download/download_job.cc » ('j') | content/browser/download/parallel_download_job.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698