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

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

Issue 2872943003: Reduce unnecessary download interruptions due to parallel requests (Closed)
Patch Set: more restrictions on DOWNLOAD_INTERRUPT_REASON_SERVER_NO_RANGE 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
« no previous file with comments | « content/browser/download/download_job.cc ('k') | content/browser/download/download_worker.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index 80be40f4e3e4849ac5ddbd5696f55f516f334690..ed24173103d329447919b88f2719b61ad1ccbd6f 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -817,21 +817,21 @@ void RecordParallelizableDownloadStats(
if (!uses_parallel_requests)
return;
+ base::TimeDelta time_saved;
if (bytes_downloaded_with_parallel_streams > 0) {
RecordBandwidthMetric(
"Download.ParallelizableDownloadBandwidth."
"WithParallelRequestsMultipleStreams",
CalculateBandwidthBytesPerSecond(bytes_downloaded_with_parallel_streams,
time_with_parallel_streams));
+ if (bandwidth_without_parallel_streams > 0) {
+ time_saved = base::TimeDelta::FromMilliseconds(
+ 1000.0 * bytes_downloaded_with_parallel_streams /
+ bandwidth_without_parallel_streams) -
+ time_with_parallel_streams;
+ }
}
- base::TimeDelta time_saved;
- if (bandwidth_without_parallel_streams > 0) {
- time_saved = base::TimeDelta::FromMilliseconds(
- 1000.0 * bytes_downloaded_with_parallel_streams /
- bandwidth_without_parallel_streams) -
- time_with_parallel_streams;
- }
int kMillisecondsPerHour =
base::checked_cast<int>(base::Time::kMillisecondsPerSecond * 60 * 60);
if (time_saved >= base::TimeDelta()) {
« no previous file with comments | « content/browser/download/download_job.cc ('k') | content/browser/download/download_worker.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698