summaryrefslogtreecommitdiffstats
path: root/content/browser/download/download_file_impl.cc
Commit message (Collapse)AuthorAgeFilesLines
* [Downloads] Release power save blocker once a download request is done.asanka@chromium.org2014-04-111-4/+1
| | | | | | | | | | | | | | | | | | | | | | DownloadFileImpl acquires a power save blocker to prevent the machine from entering power save mode while a download is in progress. This blocker wasn't being released until the DownloadFileImpl object was destroyed. Since dangerous downloads can retain the DownloadFileImpl object indefinitely until the user keeps or discards the download, the users' machine will not enter power save mode if there are any dangerous downloads. This CL moves the ownership of the PowerSaveBlocker to the underlying DownloadResourceHandler. The PSB is created in the DRH constructor and has a lifetime equal to that of the DRH. Since the DRH is destroyed after the ResourceHandler::OnResponseCompleted notification is received, the PSB will be released when the request is done. BUG=351724 Review URL: https://codereview.chromium.org/226223004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@263248 0039d316-1c4b-4281-b951-d872f2087c98
* Stop using net::FileStream synchronously in content/browser/donwloadhashimoto@chromium.org2014-04-031-1/+1
| | | | | | | | | | | Use base::File instead. BUG=351823 TEST=git cl try Review URL: https://codereview.chromium.org/197953003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261350 0039d316-1c4b-4281-b951-d872f2087c98
* Move more file_util functions to base namespace.brettw@chromium.org2014-03-131-1/+1
| | | | | | | | TBR=jam Review URL: https://codereview.chromium.org/189333004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256863 0039d316-1c4b-4281-b951-d872f2087c98
* Remove NetLog::LOG_BASIC.davidben@chromium.org2014-03-121-1/+1
| | | | | | | | | | | | It's only used in test code. Preparatory CL to introduce a LOG_STRIP_PRIVATE_DATA log level, so we don't have to break the ordering of levels. BUG=349502 Review URL: https://codereview.chromium.org/196203002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@256690 0039d316-1c4b-4281-b951-d872f2087c98
* [Downloads] Move client guid for AV scanning of downloaded files to chrome/gbillock@chromium.org2013-08-101-0/+4
| | | | | | | | This client app should not be used by all clients of content/. Moving to chrome so it can be managed there and re-used if needed. Review URL: https://chromiumcodereview.appspot.com/21355004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@216843 0039d316-1c4b-4281-b951-d872f2087c98
* Make ByteStream independent from DownloadInterruptReasontyoshino@chromium.org2013-08-021-1/+2
| | | | | | | | | | | | | | | Change status type to int to make it portable to other component. After this change, ByteStream could be moved under src/net/base/ or src/base directory. - Comment fix (MaybePostToPeer -> Write) BUG=169957 Review URL: https://chromiumcodereview.appspot.com/18284005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215265 0039d316-1c4b-4281-b951-d872f2087c98
* Persist download ids across sessions by merging them with db_handles.benjhayden@chromium.org2013-07-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Remove DownloadId from the content api. It made sense in a world with DownloadFileManager, but that world is no more. Remove meta_table.next_download_id_. {HistoryService,HistoryBackend,DownloadDatabase}::GetNextDownloadId() returns `select max(id) from downloads` + 1. GetNextDownloadId() is called once when ChromeDownloadManagerDelegate is created, before DownloadDatabase::QueryDownloads() is called. {DownloadManager,DownloadManagerDelegate}::GetNextId() is now *a*synchronous. If GetNextId() is called before History*::GetNextDownloadId() finishes, then the callback arguments go into a queue that is flushed when History*::GetNextDownloadId() calls back to CDMD. Even if the `select max(id) from downloads` statement takes a long time, browser/profile initialization is not delayed. The only operations that are delayed in this case are downloads. We cannot simply allow sqlite to automatically assign the id because some DownloadItems are never added to the history. If all items were added to the history, then we could allow sqlite to automatically assign the id by merging DownloadDatabase::CreateDownload() with DownloadDatabase::GetNextDownloadId(). But some items are never added to the history, so we don't want to create records for them. Also, that would delay surfacing *every* download to the UI by a DB thread bounce, whereas this CL only delays the downloads that are started before DownloadDatabase::GetNextDownloadId() returns. DownloadHistory now uses loading_id_ instead of loading_db_handle_. This way is safer. DownloadHistoryData uses a tri-state enum {NOT_PERSISTED, PERSISTING, PERSISTED}. The invalid id constant is moved to content::DownloadItem::kInvalidId. BUG=98253 Review URL: https://chromiumcodereview.appspot.com/15584002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@211414 0039d316-1c4b-4281-b951-d872f2087c98
* Use a direct include of time headers in content/, part 1.avi@chromium.org2013-06-281-1/+1
| | | | | | | | | | BUG=254986 TEST=none TBR=ben@chromium.org Review URL: https://codereview.chromium.org/18152002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@209148 0039d316-1c4b-4281-b951-d872f2087c98
* Update includes of message_loop_proxy.brettw@chromium.org2013-06-101-1/+1
| | | | | | | | | | | This keeps the forwarding header, just updates all current callers. BUG= R=avi@chromium.org Review URL: https://codereview.chromium.org/16514006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205306 0039d316-1c4b-4281-b951-d872f2087c98
* downloads: Improve download rate estimation.cbentzel@chromium.org2013-05-291-1/+2
| | | | | | | | | | | | | | | Previously, download rate was estimated as bytes_received/(current_time - download_start_time) Although simple, this would react slowly to dynamic changes in download time, or user initiated pauses. With this change, a ring buffer of the past 10 seconds of download time is used instead, and estimates are derived from that. It handles dynamic changes to bandwidth well. Pauses are handled reasonably well, as estimates are accurate after ten seconds - a better solution would be to clear the data rates when the user resumes from a pause. The main downside with this approach is it takes about 100 bytes of memory per active download, as well as adds some complexity. BUG=16390 TEST=content_unittests Review URL: https://chromiumcodereview.appspot.com/14697023 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@202874 0039d316-1c4b-4281-b951-d872f2087c98
* Get rid of DownloadItem::BytesSoFar.cbentzel@chromium.org2013-05-141-5/+2
| | | | | | | | This API call was not being used. Review URL: https://chromiumcodereview.appspot.com/14741010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200104 0039d316-1c4b-4281-b951-d872f2087c98
* content: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST.scherkus@chromium.org2013-04-301-1/+1
| | | | | | | | | | | It's no longer providing value as the MSVC warning is disabled during compilation. Refer to bug for details. BUG=234765 R=jam@chromium.org Review URL: https://codereview.chromium.org/14386012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197206 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-091-2/+2
| | | | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=193020 Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193040 0039d316-1c4b-4281-b951-d872f2087c98
* Revert "Rewrite std::string("") to std::string(), Linux edition."dcheng@chromium.org2013-04-091-2/+2
| | | | | | | | | | | | | | This reverts commit e59558b78e8c6a1b0bd916a724724b638c3c91b6. Revert "Fix build after r193020." This reverts commit 558a35897f6b3ffbcaefde927c1f150b815d140a. Revert "Really fix build after r193020." This reverts commit e3748a79b523a8d365d4a33ef986eebb4186fa78. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193030 0039d316-1c4b-4281-b951-d872f2087c98
* Fix build after r193020.dcheng@chromium.org2013-04-091-1/+1
| | | | | | | | | BUG= TBR=rdsmith Review URL: https://codereview.chromium.org/13927003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193026 0039d316-1c4b-4281-b951-d872f2087c98
* Rewrite std::string("") to std::string(), Linux edition.dcheng@chromium.org2013-04-091-2/+2
| | | | | | | | | | | | | | | | | This patch was generated by running the empty_string clang tool across the Chromium Linux compilation database. Implicitly or explicitly constructing std::string() with a "" argument is inefficient as the caller needs to emit extra instructions to pass an argument, and the constructor needlessly copies a byte into internal storage. Rewriting these instances to simply call the default constructor appears to save ~14-18 kilobytes on an optimized release build. BUG=none Review URL: https://codereview.chromium.org/13145003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@193020 0039d316-1c4b-4281-b951-d872f2087c98
* Move ByteStream to content/browserzork@chromium.org2013-03-211-1/+1
| | | | | | | | | BUG=180833 Review URL: https://chromiumcodereview.appspot.com/12440036 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@189665 0039d316-1c4b-4281-b951-d872f2087c98
* [Cleanup] Remove StringPrintf from global namespacegroby@chromium.org2013-03-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | use of StringPrintf now requires prefixing with base:: or a per-scope using directive TBR'd: abodenha: chrome/service brettw: content, third_party, webkit darin: base, chrome/browser, chrome/renderer dgarret: courgette enne: cc fischmann: media gbillock: sql joi: google_apis,components rsleevi: net, crypto sky: chrome/test thestig: printing, chrome/common, tsepez: ipc wez: remoting yfriedman: testing/android NOTRY=true R=brettw@chromium.org TBR=joi@chromium.org, rsleevi@chromium.org, enne@chromium.org, thestig@chromium.org, darin@chromium.org, abodenha@chromium.org, sky@chromium.org, dgarret@chromium.org, tsepez@chromium.org, fishman@chromium.org, wez@chromium.org, gbillock@chromium.org, yfriedman@chromium.org BUG= Review URL: https://codereview.chromium.org/12767006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188857 0039d316-1c4b-4281-b951-d872f2087c98
* Partially integrate filename determination with resumption.rdsmith@chromium.org2013-03-161-0/+3
| | | | | | | | | | | | Also substantially increased test coverage. BUG=7648 R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/12308011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@188562 0039d316-1c4b-4281-b951-d872f2087c98
* Use base namespace for FilePath in content/browserbrettw@chromium.org2013-02-071-6/+8
| | | | | | Review URL: https://codereview.chromium.org/12213066 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@181349 0039d316-1c4b-4281-b951-d872f2087c98
* Make content::PowerSaveBlocker publichashimoto@chromium.org2013-01-151-2/+2
| | | | | | | | | BUG=152207 Review URL: https://chromiumcodereview.appspot.com/11784016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@176806 0039d316-1c4b-4281-b951-d872f2087c98
* Split DownloadFile::Rename into RenameAndUniquify and RenameAndAnnotate.rdsmith@chromium.org2012-11-101-22/+46
| | | | | | | | | | | This matches much better with the semantics as expected by the DownloadItem. R=asanka@chromium.org BUG=159501 Review URL: https://chromiumcodereview.appspot.com/11366121 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@167028 0039d316-1c4b-4281-b951-d872f2087c98
* Minor cleanup in DownloadCreateInfo structure.rdsmith@chromium.org2012-11-011-2/+1
| | | | | | | | | | R=benjhayden@chromium.org TBR=sky@chromium.org Review URL: https://chromiumcodereview.appspot.com/11337033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165558 0039d316-1c4b-4281-b951-d872f2087c98
* Handle the case where IAttachmentExecute::Save() deletes a downloaded file.asanka@chromium.org2012-10-291-10/+5
| | | | | | | | | | | As a first step, mark the download as interrupted due to the file being blocked or due to the file being infected by a virus. The interrupt reason will be shown to the user in the downloads shelf and the downloads page. BUG=155957 Review URL: https://chromiumcodereview.appspot.com/11150027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164632 0039d316-1c4b-4281-b951-d872f2087c98
* Move download code to the content namespace.jam@chromium.org2012-10-261-35/+32
| | | | | | Review URL: https://codereview.chromium.org/11320016 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@164439 0039d316-1c4b-4281-b951-d872f2087c98
* Refactor BaseFile methods to return a DownloadInterruptReason instead of a ↵asanka@chromium.org2012-10-251-16/+7
| | | | | | | | | | | | net::Error. Also split the implementation into platform specific files. BUG=157245 Review URL: https://chromiumcodereview.appspot.com/11238044 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163983 0039d316-1c4b-4281-b951-d872f2087c98
* Replace the DownloadFileManager with direct ownership of DownloadFileImplrdsmith@chromium.org2012-10-181-63/+53
| | | | | | | | | | | | | | | by DownloadItemImpl. Relanding of http://codereview.chromium.org/10799005. BUG=123998 R=benjhayden@chromium.org R=jam@chromium.org Review URL: https://chromiumcodereview.appspot.com/10912173 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162786 0039d316-1c4b-4281-b951-d872f2087c98
* Shift passage of FileStream in downloads system to be by scoped_ptr<>.rdsmith@chromium.org2012-10-171-6/+6
| | | | | | | | | | | | | | | | http://codereview.chromium.org/10912173/ constructs the DownloadFile, and thus the BaseFile, on the UI thread and then passes it to the FILE thread. DownloadFile / BaseFile may be constructed with a FileStream to which to write the download. The FileStream cannot be passed by linked_ptr<> in this case, as that is not thread safe. BUG=123998 R=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/11028131 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@162411 0039d316-1c4b-4281-b951-d872f2087c98
* Shift "commit point" for when a download will no longer accept cancels.rdsmith@chromium.org2012-09-241-4/+16
| | | | | | | | | | | | | | | | This CL shifts the commit point for a download to just after the download file release has been dispatched. The download remains IN_PROGRESS as far as the outside world is concerned, but at this point it is committed to continue to completion. BUG=123998 R=benjhayden@chromium.org R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10950015 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@158298 0039d316-1c4b-4281-b951-d872f2087c98
* Use the user's preferred downloads directory for creating the initial ↵asanka@chromium.org2012-09-151-1/+2
| | | | | | | | | | | download file. BUG=132240 Review URL: https://chromiumcodereview.appspot.com/10905284 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@157022 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 154294 - Remove DownloadFileManager in favor of direct ownership of ↵rdsmith@chromium.org2012-08-311-65/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | DownloadFiles. This CL is equivalent to CLs * http://codereview.chromium.org/10799005, * http://codereview.chromium.org/10836293, * https://chromiumcodereview.appspot.com/10823406, and * http://codereview.chromium.org/10867065 which were previous attempts to land the same functionality. R=benjhayden@chromium.org TBR=jam@chromium.org BUG=123998 BUG=144751 Review URL: https://chromiumcodereview.appspot.com/10900010 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10918024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154445 0039d316-1c4b-4281-b951-d872f2087c98
* Remove DownloadFileManager in favor of direct ownership of DownloadFiles.rdsmith@chromium.org2012-08-301-64/+65
| | | | | | | | | | | | | | | | | | | | | This CL is equivalent to CLs * http://codereview.chromium.org/10799005, * http://codereview.chromium.org/10836293, * https://chromiumcodereview.appspot.com/10823406, and * http://codereview.chromium.org/10867065 which were previous attempts to land the same functionality. R=benjhayden@chromium.org TBR=jam@chromium.org BUG=123998 BUG=144751 Review URL: https://chromiumcodereview.appspot.com/10900010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@154294 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 153563 - Remove DownloadFileManager in favor of direct ownership of ↵isherman@chromium.org2012-08-281-65/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | DownloadFiles. This CL appears to have caused SavePageBrowserTest.SaveViewSourceHTMLOnly to fail flakily. This CL is equivalent to CLs http://codereview.chromium.org/10799005, http://codereview.chromium.org/10836293, and https://chromiumcodereview.appspot.com/10823406, which were previous attempts to land the same functionality. TBR=jam@chromium.org BUG=123998 BUG=144751 Review URL: https://chromiumcodereview.appspot.com/10867065 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10872102 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153593 0039d316-1c4b-4281-b951-d872f2087c98
* Remove DownloadFileManager in favor of direct ownership of DownloadFiles.rdsmith@chromium.org2012-08-271-64/+65
| | | | | | | | | | | | | | | | | This CL is equivalent to CLs http://codereview.chromium.org/10799005, http://codereview.chromium.org/10836293, and https://chromiumcodereview.appspot.com/10823406, which were previous attempts to land the same functionality. TBR=jam@chromium.org BUG=123998 BUG=144751 Review URL: https://chromiumcodereview.appspot.com/10867065 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153563 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 153221 - Remove DownloadFileManager in favor of direct ownership of ↵rdsmith@chromium.org2012-08-241-65/+64
| | | | | | | | | | | | | | | | | | | DownloadFiles. This CL is equivalent to CLs http://codereview.chromium.org/10799005 and http://codereview.chromium.org/10836293, which were previous attempts to land the same functionality. TBR=jam@chromium.org BUG=123998 Review URL: https://chromiumcodereview.appspot.com/10823406 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10878054 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153229 0039d316-1c4b-4281-b951-d872f2087c98
* Remove DownloadFileManager in favor of direct ownership of DownloadFiles.rdsmith@chromium.org2012-08-241-64/+65
| | | | | | | | | | | | | | This CL is equivalent to CLs http://codereview.chromium.org/10799005 and http://codereview.chromium.org/10836293, which were previous attempts to land the same functionality. TBR=jam@chromium.org BUG=123998 Review URL: https://chromiumcodereview.appspot.com/10823406 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@153221 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 152213 - Replace the DownloadFileManager with direct ownership of ↵rdsmith@chromium.org2012-08-191-65/+64
| | | | | | | | | | | | | | | | | | | | DownloadFile. This CL is a re-land of http://codereview.chromium.org/10799005, which was reverted due to test flakiness. BUG=123998 R=benjhayden@chromium.org TBR=jam@chromium.org Review URL: https://chromiumcodereview.appspot.com/10836293 BUG=143600 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10861002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152282 0039d316-1c4b-4281-b951-d872f2087c98
* Replace the DownloadFileManager with direct ownership of DownloadFile.rdsmith@chromium.org2012-08-181-64/+65
| | | | | | | | | | | | | | This CL is a re-land of http://codereview.chromium.org/10799005, which was reverted due to test flakiness. BUG=123998 R=benjhayden@chromium.org TBR=jam@chromium.org Review URL: https://chromiumcodereview.appspot.com/10836293 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@152213 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 151351 - Replace the DownloadFileManager with direct ownership yutak@chromium.org2012-08-141-65/+64
| | | | | | | | | | | | | | | of DownloadFileImpl by DownloadItemImpl. BUG=123998 R=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/10799005 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10827314 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151443 0039d316-1c4b-4281-b951-d872f2087c98
* Replace the DownloadFileManager with direct ownership rdsmith@chromium.org2012-08-131-64/+65
| | | | | | | | | | | | of DownloadFileImpl by DownloadItemImpl. BUG=123998 R=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/10799005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151351 0039d316-1c4b-4281-b951-d872f2087c98
* Move Rename functionality from DownloadFileManager to DownloadFileImple.rdsmith@chromium.org2012-07-131-7/+37
| | | | | | | | | | | | | This is a re-land of a previously reverted CL; see http://codereview.chromium.org/10689093/. BUG=123998 R=asanka@chromium.org TBR=jcivelli@chromium.org Review URL: https://chromiumcodereview.appspot.com/10700191 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146683 0039d316-1c4b-4281-b951-d872f2087c98
* Revert 146162 - Move Rename functionality from DownloadFileManager to ↵rdsmith@chromium.org2012-07-111-39/+7
| | | | | | | | | | | | | | | DownloadFileImple. BUG=123998 R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10689093 TBR=rdsmith@chromium.org Review URL: https://chromiumcodereview.appspot.com/10702151 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146177 0039d316-1c4b-4281-b951-d872f2087c98
* Move Rename functionality from DownloadFileManager to DownloadFileImple.rdsmith@chromium.org2012-07-111-7/+39
| | | | | | | | | | BUG=123998 R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10689093 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@146162 0039d316-1c4b-4281-b951-d872f2087c98
* Shifted DownloadFile to exporting DownloadInterruptReasons.rdsmith@chromium.org2012-07-031-14/+17
| | | | | | | | | | | | | | | | DownloadFile used to return net::Errors (as BaseFile does). With the folding of functionality from the DownloadFileManager implied by the ByteStream refactor (the DownloadFile gives completion messages directly to the DownloadManager), it exported some DownloadInterruptReasons. This CL takes it the rest of the way. BUG=123998 Review URL: https://chromiumcodereview.appspot.com/10696043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145376 0039d316-1c4b-4281-b951-d872f2087c98
* Improve download performance statistics.rdsmith@chromium.org2012-07-031-1/+1
| | | | | | | | | | | | | | | | | | | | | I've removed the questionable Download.BandwidthNetwork measurement, and replaced it with measurements designed to answer the question "What is the bottleneck for a download?" Specfically, this includes two new statistics: * Download.DiskBandwidthUsedPercentage: The percentage of the available disk bandwith that was actually used. 100% implies that the disk was the performance bottleneck. * Download.ResourceHandlerBlockedPercentage: The percentage of the time it was alive that the DownloadResourceHandler was throttled for performance reasons. 0% implies that the network was the performance bottleneck. R=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/10695062 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@145320 0039d316-1c4b-4281-b951-d872f2087c98
* Do the Windows source file annotation at the end of the download.rdsmith@chromium.org2012-06-261-0/+2
| | | | | | | | | | | | This can also include handoffs to anti-virus scanners. BUG=127999 R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10636030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144275 0039d316-1c4b-4281-b951-d872f2087c98
* Removed checks for NULL DownloadManager in DownloadFileImpl.rdsmith@chromium.org2012-06-251-24/+19
| | | | | | | | | | | | These never happen, so we can cleanup the code by putting in DCHECKs instead of tests. R=asanka@chromium.org Review URL: https://chromiumcodereview.appspot.com/10663005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@143994 0039d316-1c4b-4281-b951-d872f2087c98
* Simplifiy download initiation. rdsmith@chromium.org2012-06-181-1/+1
| | | | | | | | | | | | | | | | Now, instead of a three-way dance between DownloadResourceHandler, DownloadFileManager, and DownloadManager, DownloadResourceHandler tells DownloadManager to start the download, and it calls out (with return callback) to DownloadFileManager to create the DownloadFile. BUG=132832 TEST=Refactor; existing tests should continue to work. R=benjhayden@chromium.org Review URL: https://chromiumcodereview.appspot.com/10544161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142728 0039d316-1c4b-4281-b951-d872f2087c98
* NetLogEventParameter to Callback refactoring 11. mmenke@chromium.org2012-06-141-2/+2
| | | | | | | | | | | | | Get rid of all uses of NetLog::EventParameters in all remaining locations (downloads, appcache, io thread, chrome_network_delegate. R=eroman@chromium.org,rdsmith@chromium.org,michaeln@chromium.org BUG=126243 Review URL: https://chromiumcodereview.appspot.com/10542153 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142217 0039d316-1c4b-4281-b951-d872f2087c98
* Power save blocker: switch to new implementation. In addition to making thingsmdm@chromium.org2012-06-111-1/+1
| | | | | | | | | | | much simpler, this will also fix bug 126591 on Windows 8 by activating the new code in r140668. BUG=126591 Review URL: https://chromiumcodereview.appspot.com/10542089 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141433 0039d316-1c4b-4281-b951-d872f2087c98