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

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

Issue 2759843002: Pump the http version to download system. (Closed)
Patch Set: Work on feedback. 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_request_core.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/parallel_download_utils.cc
diff --git a/content/browser/download/parallel_download_utils.cc b/content/browser/download/parallel_download_utils.cc
index 4327d8d909a4fa76802fcd63c7ecb543320a04fa..b3e6ee8a5f309f9a8633644784e0f9551bb49f97 100644
--- a/content/browser/download/parallel_download_utils.cc
+++ b/content/browser/download/parallel_download_utils.cc
@@ -43,10 +43,11 @@ bool compareReceivedSlices(const DownloadItem::ReceivedSlice& lhs,
} // namespace
bool ShouldUseParallelDownload(const DownloadCreateInfo& create_info) {
+ // To enable parallel download, following conditions need to be satisfied.
// 1. Accept-Ranges, Content-Length and strong validators response headers.
// 2. Feature |kParallelDownloading| enabled.
// 3. Content-Length is no less than the minimum slice size configuration.
- // 3. TODO(xingliu) HTTP/1.1 protocol, not QUIC or HTTP/2.
+ // 3. HTTP/1.1 protocol, not QUIC nor HTTP/1.0.
// Etag and last modified are stored into DownloadCreateInfo in
// DownloadRequestCore only if the response header complies to the strong
@@ -56,6 +57,8 @@ bool ShouldUseParallelDownload(const DownloadCreateInfo& create_info) {
return has_strong_validator && create_info.accept_range &&
create_info.total_bytes >= GetMinSliceSizeConfig() &&
+ create_info.connection_info ==
+ net::HttpResponseInfo::CONNECTION_INFO_HTTP1_1 &&
base::FeatureList::IsEnabled(features::kParallelDownloading);
}
« no previous file with comments | « content/browser/download/download_request_core.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698