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

Unified Diff: content/browser/download/download_item_impl.cc

Issue 114193009: [Download] Return DownloadInterruptReason from OnStartedCallback (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 380a219cf0e64b44eded274cec9a48f8e31f38bd..a12a28c7bd78f36162e76a511f3e480514726312 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -807,7 +807,7 @@ std::string DownloadItemImpl::DebugString(bool verbose) const {
" target_path = \"%" PRFilePath "\"",
GetTotalBytes(),
GetReceivedBytes(),
- InterruptReasonDebugString(last_reason_).c_str(),
+ DownloadInterruptReasonToString(last_reason_).c_str(),
IsPaused() ? 'T' : 'F',
DebugResumeModeString(GetResumeMode()),
auto_resume_count_,
@@ -868,6 +868,7 @@ DownloadItemImpl::ResumeMode DownloadItemImpl::GetResumeMode() const {
case DOWNLOAD_INTERRUPT_REASON_NETWORK_FAILED:
case DOWNLOAD_INTERRUPT_REASON_NETWORK_DISCONNECTED:
case DOWNLOAD_INTERRUPT_REASON_NETWORK_SERVER_DOWN:
+ case DOWNLOAD_INTERRUPT_REASON_NETWORK_INVALID_REQUEST:
case DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED:
case DOWNLOAD_INTERRUPT_REASON_USER_SHUTDOWN:
case DOWNLOAD_INTERRUPT_REASON_CRASH:
@@ -1382,23 +1383,20 @@ void DownloadItemImpl::Completed() {
}
}
-void DownloadItemImpl::OnResumeRequestStarted(DownloadItem* item,
- net::Error error) {
+void DownloadItemImpl::OnResumeRequestStarted(
+ DownloadItem* item,
+ DownloadInterruptReason interrupt_reason) {
// If |item| is not NULL, then Start() has been called already, and nothing
// more needs to be done here.
if (item) {
- DCHECK_EQ(net::OK, error);
+ DCHECK_EQ(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
DCHECK_EQ(static_cast<DownloadItem*>(this), item);
return;
}
// Otherwise, the request failed without passing through
// DownloadResourceHandler::OnResponseStarted.
- if (error == net::OK)
- error = net::ERR_FAILED;
- DownloadInterruptReason reason =
- ConvertNetErrorToInterruptReason(error, DOWNLOAD_INTERRUPT_FROM_NETWORK);
- DCHECK_NE(DOWNLOAD_INTERRUPT_REASON_NONE, reason);
- Interrupt(reason);
+ DCHECK_NE(DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
+ Interrupt(interrupt_reason);
}
// **** End of Download progression cascade
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698