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

Side by Side Diff: content/browser/download/download_item_impl.cc

Issue 2750713003: Add UMA for estimating disk bandwidth and the time saved with parallel download (Closed)
Patch Set: address comments 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // File method ordering: Methods in this file are in the same order as 5 // File method ordering: Methods in this file are in the same order as
6 // in download_item_impl.h, with the following exception: The public 6 // in download_item_impl.h, with the following exception: The public
7 // interface Start is placed in chronological order with the other 7 // interface Start is placed in chronological order with the other
8 // (private) routines that together define a DownloadItem's state 8 // (private) routines that together define a DownloadItem's state
9 // transitions as the download progresses. See "Download progression 9 // transitions as the download progresses. See "Download progression
10 // cascade" later in this file. 10 // cascade" later in this file.
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 // |DownloadJob::is_paused_| even if there's no request currently 371 // |DownloadJob::is_paused_| even if there's no request currently
372 // associated with this DII. When a request is assigned (due to a 372 // associated with this DII. When a request is assigned (due to a
373 // resumption, for example) we can honor the |DownloadJob::is_paused_| 373 // resumption, for example) we can honor the |DownloadJob::is_paused_|
374 // setting. 374 // setting.
375 return; 375 return;
376 376
377 case IN_PROGRESS_INTERNAL: 377 case IN_PROGRESS_INTERNAL:
378 case TARGET_PENDING_INTERNAL: 378 case TARGET_PENDING_INTERNAL:
379 job_->Pause(); 379 job_->Pause();
380 UpdateObservers(); 380 UpdateObservers();
381 if (download_file_) {
382 BrowserThread::PostTask(
383 BrowserThread::FILE, FROM_HERE,
384 base::Bind(&DownloadFile::WasPaused,
385 // Safe because we control download file lifetime.
386 base::Unretained(download_file_.get())));
387 }
381 return; 388 return;
382 389
383 case MAX_DOWNLOAD_INTERNAL_STATE: 390 case MAX_DOWNLOAD_INTERNAL_STATE:
384 case TARGET_RESOLVED_INTERNAL: 391 case TARGET_RESOLVED_INTERNAL:
385 NOTREACHED(); 392 NOTREACHED();
386 } 393 }
387 } 394 }
388 395
389 void DownloadItemImpl::Resume() { 396 void DownloadItemImpl::Resume() {
390 DCHECK_CURRENTLY_ON(BrowserThread::UI); 397 DCHECK_CURRENTLY_ON(BrowserThread::UI);
(...skipping 1774 matching lines...) Expand 10 before | Expand all | Expand 10 after
2165 case RESUME_MODE_USER_CONTINUE: 2172 case RESUME_MODE_USER_CONTINUE:
2166 return "USER_CONTINUE"; 2173 return "USER_CONTINUE";
2167 case RESUME_MODE_USER_RESTART: 2174 case RESUME_MODE_USER_RESTART:
2168 return "USER_RESTART"; 2175 return "USER_RESTART";
2169 } 2176 }
2170 NOTREACHED() << "Unknown resume mode " << mode; 2177 NOTREACHED() << "Unknown resume mode " << mode;
2171 return "unknown"; 2178 return "unknown";
2172 } 2179 }
2173 2180
2174 } // namespace content 2181 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.cc ('k') | content/browser/download/download_stats.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698