diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 04:18:05 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-23 04:18:05 +0000 |
commit | 36e93a7796e1551fafeaaed832f166a2a6d9bb2b (patch) | |
tree | 6653c08fae8302920cc2bae5c5a67a0b1f586bcc /chrome/browser/download/download_file.cc | |
parent | b384d90d7713768c2eb9191ea0d2410f9c9ac0fc (diff) | |
download | chromium_src-36e93a7796e1551fafeaaed832f166a2a6d9bb2b.zip chromium_src-36e93a7796e1551fafeaaed832f166a2a6d9bb2b.tar.gz chromium_src-36e93a7796e1551fafeaaed832f166a2a6d9bb2b.tar.bz2 |
Disable system suspend while downloading files on win32.
If the system goes into power-save sleep mode while downloading files,
the download fails. So, prevent sleep mode until the download finishes.
This patch introduces a new RAII class to request that the system's
power-save mode be disabled - PowerSaveBlocker.
This is only implemented for win32; other platforms are stubbed out.
This only partially implements bug 25420 it only attempts to handle the
downloading case.
Patch by Bryan Donlan <bdonlan@gmail.com>
BUG=25420
TEST=Download a large file with the system sleep timeout set to a short interval.
Review URL: http://codereview.chromium.org/287017
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29873 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_file.cc')
-rw-r--r-- | chrome/browser/download/download_file.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 7066b5b..b340d00 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -65,7 +65,8 @@ DownloadFile::DownloadFile(const DownloadCreateInfo* info) request_id_(info->request_id), bytes_so_far_(0), path_renamed_(false), - in_progress_(true) { + in_progress_(true), + dont_sleep_(true) { } DownloadFile::~DownloadFile() { |