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

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

Issue 2730363004: Parallel Download finch config parameters on Chrome client. (Closed)
Patch Set: Fix for new code merged in. 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_file_impl.cc ('k') | content/browser/download/parallel_download_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_job_factory.cc
diff --git a/content/browser/download/download_job_factory.cc b/content/browser/download/download_job_factory.cc
index 9c18262fbcc0a8cb9446757d261c83e78340650e..3d292c96cc4663e9c1a239ef4caecd702cfd13a0 100644
--- a/content/browser/download/download_job_factory.cc
+++ b/content/browser/download/download_job_factory.cc
@@ -11,20 +11,17 @@
#include "content/browser/download/download_job.h"
#include "content/browser/download/download_job_impl.h"
#include "content/browser/download/parallel_download_job.h"
+#include "content/browser/download/parallel_download_utils.h"
#include "content/public/common/content_features.h"
namespace content {
namespace {
-// Default minimum file size in bytes to enable a parallel download, 2048KB.
-// TODO(xingliu): Use finch parameters to configure minimum file size.
-const int64_t kMinFileSizeParallelDownload = 2097152;
-
bool ShouldUseParallelDownload(const DownloadCreateInfo& create_info) {
// 1. Accept-Ranges, Content-Length and strong validators response headers.
// 2. Feature |kParallelDownloading| enabled.
- // 3. Content-Length is no less than |kMinFileSizeParallelDownload|.
+ // 3. Content-Length is no less than the minimum slice size configuration.
// 3. (Undetermined) Http/1.1 protocol.
// 4. (Undetermined) Not under http proxy, e.g. data saver.
@@ -35,7 +32,7 @@ bool ShouldUseParallelDownload(const DownloadCreateInfo& create_info) {
!create_info.etag.empty() || !create_info.last_modified.empty();
return has_strong_validator && create_info.accept_range &&
- create_info.total_bytes >= kMinFileSizeParallelDownload &&
+ create_info.total_bytes >= GetMinSliceSizeConfig() &&
base::FeatureList::IsEnabled(features::kParallelDownloading);
}
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/parallel_download_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698