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

Unified Diff: ios/chrome/browser/reading_list/url_downloader.cc

Issue 2703773002: [IOS Reading List] Change handling of distillation error. (Closed)
Patch Set: feedback Created 3 years, 10 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 | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/reading_list/url_downloader.cc
diff --git a/ios/chrome/browser/reading_list/url_downloader.cc b/ios/chrome/browser/reading_list/url_downloader.cc
index b73616bcc1e8a1187e46e655922139f960e9d0cd..d4588672bd7417810ce9ba4f30ec4d455ca08af3 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -112,7 +112,7 @@ void URLDownloader::DownloadCompletionHandler(
base::Unretained(this), url, title, offline_path, success);
// If downloading failed, clean up any partial download.
- if (success == ERROR_RETRY || success == ERROR_PERMANENT) {
+ if (success == ERROR) {
base::FilePath directory_path =
reading_list::OfflineURLDirectoryAbsolutePath(base_directory_, url);
task_tracker_.PostTaskAndReply(
@@ -202,7 +202,7 @@ void URLDownloader::OnURLFetchComplete(const net::URLFetcher* source) {
fetcher_->GetResponseHeaders()->GetMimeType(&mime_type);
}
if (!fetcher_->GetStatus().is_success() || mime_type != mime_type_) {
- return DownloadCompletionHandler(original_url_, "", path, ERROR_RETRY);
+ return DownloadCompletionHandler(original_url_, "", path, ERROR);
}
base::FilePath temporary_path;
// Do not take ownership of the file until the file is moved. This ensures
@@ -240,11 +240,11 @@ URLDownloader::SuccessState URLDownloader::SavePDFFile(
if (base::Move(temporary_path, absolute_path)) {
return DOWNLOAD_SUCCESS;
} else {
- return ERROR_PERMANENT;
+ return ERROR;
}
}
- return ERROR_PERMANENT;
+ return ERROR;
}
void URLDownloader::DistillerCallback(
@@ -262,8 +262,7 @@ void URLDownloader::DistillerCallback(
return;
}
// This content cannot be processed, return an error value to the client.
- DownloadCompletionHandler(page_url, std::string(), base::FilePath(),
- ERROR_RETRY);
+ DownloadCompletionHandler(page_url, std::string(), base::FilePath(), ERROR);
return;
}
@@ -288,9 +287,9 @@ URLDownloader::SuccessState URLDownloader::SaveDistilledHTML(
if (CreateOfflineURLDirectory(url)) {
return SaveHTMLForURL(SaveAndReplaceImagesInHTML(url, html, images), url)
? DOWNLOAD_SUCCESS
- : ERROR_PERMANENT;
+ : ERROR;
}
- return ERROR_PERMANENT;
+ return ERROR;
}
bool URLDownloader::CreateOfflineURLDirectory(const GURL& url) {
« no previous file with comments | « ios/chrome/browser/reading_list/url_downloader.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698