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

Unified Diff: content/browser/download/parallel_download_job.h

Issue 2750853004: Add a delay to send the parallel requests. (Closed)
Patch Set: Work on nits. 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 | « no previous file | content/browser/download/parallel_download_job.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/parallel_download_job.h
diff --git a/content/browser/download/parallel_download_job.h b/content/browser/download/parallel_download_job.h
index 8d02a7984fb2992982c724f9be56fb6586b11d17..37cbbf78fce21b85e626abc0e6597fe385c34cba 100644
--- a/content/browser/download/parallel_download_job.h
+++ b/content/browser/download/parallel_download_job.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/macros.h"
+#include "base/timer/timer.h"
#include "content/browser/download/download_job_impl.h"
#include "content/browser/download/download_worker.h"
#include "content/common/content_export.h"
@@ -45,6 +46,10 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl {
int64_t total_bytes,
int request_count);
+ // Build parallel requests after a delay, to effectively measure the single
+ // stream bandwidth.
+ void BuildParallelRequestAfterDelay();
+
// Build parallel requests to download the remaining slices.
// TODO(qinmin): remove ForkRequestsForNewDownload() and move the logic into
// this function.
@@ -60,6 +65,12 @@ class CONTENT_EXPORT ParallelDownloadJob : public DownloadJobImpl {
// Subsequent tasks to send range requests.
WorkerList workers_;
+ // Used to send parallel requests after a delay based on Finch config.
+ base::OneShotTimer timer_;
+
+ // If we have sent parallel requests.
+ bool requests_sent_;
+
DISALLOW_COPY_AND_ASSIGN(ParallelDownloadJob);
};
« no previous file with comments | « no previous file | content/browser/download/parallel_download_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698