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

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

Issue 20609004: [Downloads] Some UMA for downloads resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1366 matching lines...) Expand 10 before | Expand all | Expand 10 after
1377 // won't download any more data. However, a) there are currently no 1377 // won't download any more data. However, a) there are currently no
1378 // continuable errors that can occur after we download all the data, and 1378 // continuable errors that can occur after we download all the data, and
1379 // b) if there were, that would probably simply result in a null range 1379 // b) if there were, that would probably simply result in a null range
1380 // request, which would generate a DestinationCompleted() notification 1380 // request, which would generate a DestinationCompleted() notification
1381 // from the DownloadFile, which would behave properly with setting 1381 // from the DownloadFile, which would behave properly with setting
1382 // all_data_saved_ to false here. 1382 // all_data_saved_ to false here.
1383 all_data_saved_ = false; 1383 all_data_saved_ = false;
1384 1384
1385 TransitionTo(INTERRUPTED_INTERNAL, DONT_UPDATE_OBSERVERS); 1385 TransitionTo(INTERRUPTED_INTERNAL, DONT_UPDATE_OBSERVERS);
1386 RecordDownloadInterrupted(reason, received_bytes_, total_bytes_); 1386 RecordDownloadInterrupted(reason, received_bytes_, total_bytes_);
1387 if (!GetWebContents())
1388 RecordDownloadCount(INTERRUPTED_WITHOUT_WEBCONTENTS);
1387 1389
1388 AutoResumeIfValid(); 1390 AutoResumeIfValid();
1389 UpdateObservers(); 1391 UpdateObservers();
1390 } 1392 }
1391 1393
1392 void DownloadItemImpl::ReleaseDownloadFile(bool destroy_file) { 1394 void DownloadItemImpl::ReleaseDownloadFile(bool destroy_file) {
1393 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 1395 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
1394 1396
1395 if (destroy_file) { 1397 if (destroy_file) {
1396 BrowserThread::PostTask( 1398 BrowserThread::PostTask(
(...skipping 285 matching lines...) Expand 10 before | Expand all | Expand 10 after
1682 case RESUME_MODE_USER_CONTINUE: 1684 case RESUME_MODE_USER_CONTINUE:
1683 return "USER_CONTINUE"; 1685 return "USER_CONTINUE";
1684 case RESUME_MODE_USER_RESTART: 1686 case RESUME_MODE_USER_RESTART:
1685 return "USER_RESTART"; 1687 return "USER_RESTART";
1686 } 1688 }
1687 NOTREACHED() << "Unknown resume mode " << mode; 1689 NOTREACHED() << "Unknown resume mode " << mode;
1688 return "unknown"; 1690 return "unknown";
1689 } 1691 }
1690 1692
1691 } // namespace content 1693 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698