[Download] Return DownloadInterruptReason from OnStartedCallback
commit7f391888950e6517a9550783497ce9ce529b67da
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 14 Jan 2014 06:14:56 +0000 (14 06:14 +0000)
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>
Tue, 14 Jan 2014 06:14:56 +0000 (14 06:14 +0000)
tree2f0c6fe8e28fdc575151198c9dfae2cc277873db
parent66d4e0f30c56363cd5dca3b8d6a7c452e128d28f
[Download] Return DownloadInterruptReason from OnStartedCallback

DownloadUrlParameters::OnStartedCallback is invoked when the server
response is received for a newly started download. If there's an error,
this callback used to receive a net::Error indicating why.

This CL changes the return value to a DownloadInterruptReason so that
the callback can indicate error conditions that affect downloads that
aren't considered errors at the network layer. Also, it avoids having to
call DownloadManager::Start() when the response indicates that a
download is not possible.

Currently downloads that fail to start return a net::Error, but those
that fail after starting return a DownloadInterruptReason. With this
change, all downloads will return a DownloadInterruptReason regardless
of when the download is interrupted.

BUG=7648

Review URL: https://codereview.chromium.org/114193009

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@244657 0039d316-1c4b-4281-b951-d872f2087c98
33 files changed:
android_webview/browser/renderer_host/aw_resource_dispatcher_host_delegate.cc
chrome/browser/download/download_browsertest.cc
chrome/browser/download/download_item_model.cc
chrome/browser/download/download_item_model_unittest.cc
chrome/browser/extensions/api/downloads/downloads_api.cc
chrome/browser/extensions/api/downloads/downloads_api.h
chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc
chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
chrome/browser/extensions/api/image_writer_private/write_from_url_operation.h
chrome/browser/extensions/webstore_installer.cc
chrome/browser/extensions/webstore_installer.h
chrome/browser/history/history_unittest.cc
chrome/browser/plugins/plugin_installer.cc
chrome/browser/plugins/plugin_installer.h
chrome/common/extensions/api/downloads.idl
content/browser/download/download_interrupt_reasons_impl.cc
content/browser/download/download_item_impl.cc
content/browser/download/download_item_impl.h
content/browser/download/download_manager_impl.cc
content/browser/download/download_net_log_parameters.cc
content/browser/download/download_resource_handler.cc
content/browser/download/download_resource_handler.h
content/browser/download/drag_download_file.cc
content/browser/indexed_db/indexed_db_internals_ui.cc
content/browser/indexed_db/indexed_db_internals_ui.h
content/browser/loader/resource_dispatcher_host_impl.cc
content/browser/loader/resource_dispatcher_host_impl.h
content/public/browser/download_interrupt_reason_values.h
content/public/browser/download_interrupt_reasons.h
content/public/browser/download_url_parameters.h
content/public/browser/resource_dispatcher_host.h
content/public/test/download_test_observer.cc
content/public/test/download_test_observer.h