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

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

Issue 2794683002: set content length limit if half open range request fails (Closed)
Patch Set: 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.cc
diff --git a/content/browser/download/download_job.cc b/content/browser/download/download_job.cc
index c527014d189feab81144c923095b97dc493e3c7a..0583ddf8429ff42c50553597ce8ded2454a116a5 100644
--- a/content/browser/download/download_job.cc
+++ b/content/browser/download/download_job.cc
@@ -51,6 +51,16 @@ bool DownloadJob::AddByteStream(std::unique_ptr<ByteStreamReader> stream_reader,
return true;
}
+void DownloadJob::SetContentLengthLimit(int64_t limit) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ DownloadFile* download_file = download_item_->download_file_.get();
+ if (download_file) {
+ BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DownloadFile::SetContentLengthLimit,
+ base::Unretained(download_file), limit));
+ }
+}
+
bool DownloadJob::UsesParallelRequests() const {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698