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

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

Issue 2872943003: Reduce unnecessary download interruptions due to parallel requests (Closed)
Patch Set: Created 3 years, 7 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_file_impl.cc
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index 13ce1604c49dba528a3f28329792b057b0ed7921..7ebbb4fea76f31caf6f0bb786d690e3b1779b1d8 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -441,9 +441,16 @@ void DownloadFileImpl::StreamActive(SourceStream* source_stream) {
break;
case ByteStreamReader::STREAM_COMPLETE:
{
- reason = static_cast<DownloadInterruptReason>(
+ reason = static_cast<DownloadInterruptReason>(
source_stream->stream_reader()->GetStatus());
- SendUpdate();
+ if (source_stream->length() == DownloadSaveInfo::kLengthFullContent &&
+ reason == DownloadInterruptReason::
+ DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE) {
xingliu 2017/05/10 01:40:17 Are errors for non-parallel download also affected
qinmin 2017/05/10 17:47:24 For non-parallel download, if we receive DOWNLOAD_
+ // We are probably reaching the end of the stream, don't treat this
+ // as an error.
+ reason = DOWNLOAD_INTERRUPT_REASON_NONE;
+ }
+ SendUpdate();
}
break;
default:
« no previous file with comments | « no previous file | content/browser/download/download_stats.cc » ('j') | content/browser/download/download_worker.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698