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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.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/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index 8a0e1616f88cce31a4354e5cc004ad9440355e08..d63054a909f5711cdac3b0a6dff8f23b42bfe64d 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -260,10 +260,10 @@ scoped_ptr<base::DictionaryValue> DownloadItemToJSON(
json->SetInteger(kTotalBytesKey, download_item->GetTotalBytes());
json->SetBoolean(kIncognitoKey, profile->IsOffTheRecord());
if (download_item->GetState() == DownloadItem::INTERRUPTED) {
- json->SetString(kErrorKey, content::InterruptReasonDebugString(
+ json->SetString(kErrorKey, content::DownloadInterruptReasonToString(
download_item->GetLastReason()));
} else if (download_item->GetState() == DownloadItem::CANCELLED) {
- json->SetString(kErrorKey, content::InterruptReasonDebugString(
+ json->SetString(kErrorKey, content::DownloadInterruptReasonToString(
content::DOWNLOAD_INTERRUPT_REASON_USER_CANCELED));
}
if (!download_item->GetEndTime().is_null())
@@ -1037,11 +1037,11 @@ void DownloadsDownloadFunction::OnStarted(
const base::FilePath& creator_suggested_filename,
downloads::FilenameConflictAction creator_conflict_action,
DownloadItem* item,
- net::Error error) {
+ content::DownloadInterruptReason interrupt_reason) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- VLOG(1) << __FUNCTION__ << " " << item << " " << error;
+ VLOG(1) << __FUNCTION__ << " " << item << " " << interrupt_reason;
if (item) {
- DCHECK_EQ(net::OK, error);
+ DCHECK_EQ(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
SetResult(new base::FundamentalValue(static_cast<int>(item->GetId())));
if (!creator_suggested_filename.empty()) {
ExtensionDownloadsEventRouterData* data =
@@ -1058,8 +1058,8 @@ void DownloadsDownloadFunction::OnStarted(
item, GetExtension()->id(), GetExtension()->name());
item->UpdateObservers();
} else {
- DCHECK_NE(net::OK, error);
- error_ = net::ErrorToString(error);
+ DCHECK_NE(content::DOWNLOAD_INTERRUPT_REASON_NONE, interrupt_reason);
+ error_ = content::DownloadInterruptReasonToString(interrupt_reason);
}
SendResponse(error_.empty());
}

Powered by Google App Engine
This is Rietveld 408576698