| Index: content/browser/download/download_worker.h
|
| diff --git a/content/browser/download/download_worker.h b/content/browser/download/download_worker.h
|
| index 75a7f96c04d2a70b3160ad678d59be91b83445dc..111927471865d74b2d032f7e1217042bafedf6aa 100644
|
| --- a/content/browser/download/download_worker.h
|
| +++ b/content/browser/download/download_worker.h
|
| @@ -23,9 +23,24 @@ namespace content {
|
| // download.
|
| class DownloadWorker : public UrlDownloader::Delegate {
|
| public:
|
| - DownloadWorker();
|
| + class Delegate {
|
| + public:
|
| + // Called when the the byte stream is established after server response is
|
| + // handled. The stream contains data starts from |offset| of the
|
| + // destination file.
|
| + virtual void OnByteStreamReady(
|
| + DownloadWorker* worker,
|
| + std::unique_ptr<ByteStreamReader> stream_reader) = 0;
|
| + };
|
| +
|
| + DownloadWorker(DownloadWorker::Delegate* delegate,
|
| + int64_t offset,
|
| + int64_t length);
|
| virtual ~DownloadWorker();
|
|
|
| + int64_t offset() const { return offset_; }
|
| + int64_t length() const { return length_; }
|
| +
|
| // Send network request to ask for a download.
|
| void SendRequest(std::unique_ptr<DownloadUrlParameters> params);
|
|
|
| @@ -46,6 +61,14 @@ class DownloadWorker : public UrlDownloader::Delegate {
|
| std::unique_ptr<UrlDownloader, BrowserThread::DeleteOnIOThread>
|
| downloader);
|
|
|
| + DownloadWorker::Delegate* delegate_;
|
| +
|
| + // The starting position of the content for this worker to download.
|
| + int64_t offset_;
|
| +
|
| + // The length of the request. May be 0 to fetch to the end of the file.
|
| + int64_t length_;
|
| +
|
| // Used to control the network request. Live on UI thread.
|
| std::unique_ptr<DownloadRequestHandleInterface> request_handle_;
|
|
|
|
|