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

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

Issue 2742093002: Glue parallel download job and download file together. (Closed)
Patch Set: Rebase, and adjust unittests with recent landed CLs. 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_worker.h ('k') | content/browser/download/mock_download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_worker.cc
diff --git a/content/browser/download/download_worker.cc b/content/browser/download/download_worker.cc
index d537b1d9951e818909a3ebf3d8957f794142ba1e..6cea949a7355ee52e6f0b7627d84fbb414bf54fc 100644
--- a/content/browser/download/download_worker.cc
+++ b/content/browser/download/download_worker.cc
@@ -32,7 +32,13 @@ CreateUrlDownloader(std::unique_ptr<DownloadUrlParameters> params,
} // namespace
-DownloadWorker::DownloadWorker() : weak_factory_(this) {}
+DownloadWorker::DownloadWorker(DownloadWorker::Delegate* delegate,
+ int64_t offset,
+ int64_t length)
+ : delegate_(delegate),
+ offset_(offset),
+ length_(length),
+ weak_factory_(this) {}
DownloadWorker::~DownloadWorker() = default;
@@ -77,6 +83,8 @@ void DownloadWorker::OnUrlDownloaderStarted(
}
request_handle_ = std::move(create_info->request_handle);
+ if (delegate_)
+ delegate_->OnByteStreamReady(this, std::move(stream_reader));
}
void DownloadWorker::OnUrlDownloaderStopped(UrlDownloader* downloader) {
« no previous file with comments | « content/browser/download/download_worker.h ('k') | content/browser/download/mock_download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698