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

Unified Diff: chrome/browser/extensions/api/image_writer_private/write_from_url_operation.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
Index: chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
diff --git a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
index 4b39ff225be679563ea9e86d5df7c0476b99a731..5fe42e0bbadb0fb32319b4f9141ea54c01f07985 100644
--- a/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
+++ b/chrome/browser/extensions/api/image_writer_private/write_from_url_operation.cc
@@ -108,8 +108,9 @@ void WriteFromUrlOperation::DownloadStart() {
download_manager->DownloadUrl(download_params.Pass());
}
-void WriteFromUrlOperation::OnDownloadStarted(content::DownloadItem* item,
- net::Error error) {
+void WriteFromUrlOperation::OnDownloadStarted(
+ content::DownloadItem* item,
+ content::DownloadInterruptReason interrupt_reason) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
if (download_stopped_) {
@@ -120,7 +121,7 @@ void WriteFromUrlOperation::OnDownloadStarted(content::DownloadItem* item,
}
if (item) {
- DCHECK_EQ(net::OK, error);
+ DCHECK_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
download_ = item;
download_->AddObserver(this);
@@ -128,10 +129,10 @@ void WriteFromUrlOperation::OnDownloadStarted(content::DownloadItem* item,
// Run at least once.
OnDownloadUpdated(download_);
} else {
- DCHECK_NE(net::OK, error);
+ DCHECK_NE(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
std::string error_message = ErrorUtils::FormatErrorMessage(
"Download failed: *",
- net::ErrorToString(error));
+ content::DownloadInterruptReasonToString(interrupt_reason));
Error(error_message);
}
}

Powered by Google App Engine
This is Rietveld 408576698