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

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

Issue 2767593003: Handle early pause, cancel for parallel requests. (Closed)
Patch Set: Move is_canceled_ to subclass. 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
« no previous file with comments | « content/browser/download/download_job.cc ('k') | content/browser/download/download_worker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_worker.h
diff --git a/content/browser/download/download_worker.h b/content/browser/download/download_worker.h
index 62573e42496d6de9c88490fa1ac10a4d445900ab..45b85b53db88ad9360baa06dad52b6da67fcbd66 100644
--- a/content/browser/download/download_worker.h
+++ b/content/browser/download/download_worker.h
@@ -12,6 +12,7 @@
#include "content/browser/byte_stream.h"
#include "content/browser/download/download_request_handle.h"
#include "content/browser/download/url_downloader.h"
+#include "content/common/content_export.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/download_url_parameters.h"
@@ -21,7 +22,7 @@ namespace content {
// file after handling response of the original non-range request.
// TODO(xingliu): we should consider to reuse this class for single connection
// download.
-class DownloadWorker : public UrlDownloader::Delegate {
+class CONTENT_EXPORT DownloadWorker : public UrlDownloader::Delegate {
public:
class Delegate {
public:
@@ -72,6 +73,10 @@ class DownloadWorker : public UrlDownloader::Delegate {
// The length of the request. May be 0 to fetch to the end of the file.
int64_t length_;
+ // States of the worker.
+ bool is_paused_;
+ bool is_canceled_;
+
// Used to control the network request. Live on UI thread.
std::unique_ptr<DownloadRequestHandleInterface> request_handle_;
« no previous file with comments | « content/browser/download/download_job.cc ('k') | content/browser/download/download_worker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698