diff options
author | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 19:20:02 +0000 |
---|---|---|
committer | asanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-05-15 19:20:02 +0000 |
commit | 89ec81f42def3e4288ca896fa7d43c7cbf3157cc (patch) | |
tree | 59b365f901ce7317dce0328a6329f7d5c2f4bca9 /content/browser/download/download_resource_handler.cc | |
parent | 808ce2627100ce6b07b8e3a3b35a136069a8a204 (diff) | |
download | chromium_src-89ec81f42def3e4288ca896fa7d43c7cbf3157cc.zip chromium_src-89ec81f42def3e4288ca896fa7d43c7cbf3157cc.tar.gz chromium_src-89ec81f42def3e4288ca896fa7d43c7cbf3157cc.tar.bz2 |
[Downloads] Add a RESUMING_INTERNAL state to DownloadItem.
When resuming an interrupted download, the download switches to this
state after the resumption request has been dispatched. This prevents a
second resumption request from being sent during the window between
dispatching the first request and receiving a response.
BUG=7648
Review URL: https://chromiumcodereview.appspot.com/14955002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@200332 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/download/download_resource_handler.cc')
-rw-r--r-- | content/browser/download/download_resource_handler.cc | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc index 388bcd1..35c6b24 100644 --- a/content/browser/download/download_resource_handler.cc +++ b/content/browser/download/download_resource_handler.cc @@ -65,8 +65,9 @@ static void StartOnUIThread( DownloadItem* item = download_manager->StartDownload( info.Pass(), stream.Pass()); + // |item| can be NULL if the download has been removed. if (!started_cb.is_null()) - started_cb.Run(item, net::OK); + started_cb.Run(item, item ? net::OK : net::ERR_ABORTED); } } // namespace |