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

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

Issue 2730363004: Parallel Download finch config parameters on Chrome client. (Closed)
Patch Set: Use a cleaner api. 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_factory.cc
diff --git a/content/browser/download/download_job_factory.cc b/content/browser/download/download_job_factory.cc
index 3123aef43616b2dd6425fccd761619fed170c4f9..12f6e1657b191c83c433989b4ee32f99eeaad4af 100644
--- a/content/browser/download/download_job_factory.cc
+++ b/content/browser/download/download_job_factory.cc
@@ -11,16 +11,13 @@
#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.
@@ -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 >= GetMinFileSizeConfig() &&
base::FeatureList::IsEnabled(features::kParallelDownloading);
}
« no previous file with comments | « no previous file | content/browser/download/parallel_download_job.cc » ('j') | content/browser/download/parallel_download_utils.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698