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

Unified Diff: chrome/browser/extensions/api/recovery_private/write_from_url_operation.cc

Issue 23496076: WIP - Refactor programmatic downloads Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 3 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/recovery_private/write_from_url_operation.cc
diff --git a/chrome/browser/extensions/api/recovery_private/write_from_url_operation.cc b/chrome/browser/extensions/api/recovery_private/write_from_url_operation.cc
index 898c66380559e1f02067885a2c8d90c3a7421dcb..465df1e7c0afd64fe4156ade395be68262f01dad 100644
--- a/chrome/browser/extensions/api/recovery_private/write_from_url_operation.cc
+++ b/chrome/browser/extensions/api/recovery_private/write_from_url_operation.cc
@@ -120,11 +120,12 @@ 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 (item) {
- DCHECK_EQ(net::OK, error);
+ DCHECK_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
download_ = item;
download_->AddObserver(this);
@@ -132,10 +133,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