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

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

Issue 2823273004: Add new UMA stats for parallelizable download (Closed)
Patch Set: fix test Created 3 years, 8 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.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_file_impl.cc
diff --git a/content/browser/download/download_file_impl.cc b/content/browser/download/download_file_impl.cc
index 8e6941676760984230e6337b48363a8d1ff42481..dd2cb8578dd13fa15b00e9327421e4082dc2395b 100644
--- a/content/browser/download/download_file_impl.cc
+++ b/content/browser/download/download_file_impl.cc
@@ -106,7 +106,7 @@ DownloadFileImpl::DownloadFileImpl(
potential_file_length_(kUnknownContentLength),
bytes_seen_(0),
num_active_streams_(0),
- record_stream_bandwidth_(true),
+ record_stream_bandwidth_(false),
bytes_seen_with_parallel_streams_(0),
bytes_seen_without_parallel_streams_(0),
observer_(observer),
@@ -130,7 +130,8 @@ DownloadFileImpl::~DownloadFileImpl() {
void DownloadFileImpl::Initialize(
const InitializeCallback& initialize_callback,
const CancelRequestCallback& cancel_request_callback,
- const DownloadItem::ReceivedSlices& received_slices) {
+ const DownloadItem::ReceivedSlices& received_slices,
+ bool is_parallelizable) {
DCHECK_CURRENTLY_ON(BrowserThread::FILE);
update_timer_.reset(new base::RepeatingTimer());
@@ -157,6 +158,7 @@ void DownloadFileImpl::Initialize(
download_start_ = base::TimeTicks::Now();
last_update_time_ = download_start_;
+ record_stream_bandwidth_ = is_parallelizable;
// Primarily to make reset to zero in restart visible to owner.
SendUpdate();
@@ -488,11 +490,12 @@ void DownloadFileImpl::StreamActive(SourceStream* source_stream) {
if (IsDownloadCompleted()) {
RecordFileBandwidth(bytes_seen_, disk_writes_time_,
base::TimeTicks::Now() - download_start_);
- if (IsSparseFile() && record_stream_bandwidth_) {
- RecordParallelDownloadStats(bytes_seen_with_parallel_streams_,
- download_time_with_parallel_streams_,
- bytes_seen_without_parallel_streams_,
- download_time_without_parallel_streams_);
+ if (record_stream_bandwidth_) {
+ RecordParallelizableDownloadStats(
+ bytes_seen_with_parallel_streams_,
+ download_time_with_parallel_streams_,
+ bytes_seen_without_parallel_streams_,
+ download_time_without_parallel_streams_, IsSparseFile());
}
weak_factory_.InvalidateWeakPtrs();
std::unique_ptr<crypto::SecureHash> hash_state = file_.Finish();
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_file_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698