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

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

Issue 2565753002: Only distill unread items (Closed)
Patch Set: past tense in comments Created 4 years 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 bd69408dc2fecb51e27d8838968c769c52575353..6be56c989c286b1f2e5a9e5c12cab5efa7c59de9 100644
--- a/ios/chrome/browser/reading_list/url_downloader.cc
+++ b/ios/chrome/browser/reading_list/url_downloader.cc
@@ -50,9 +50,7 @@ void URLDownloader::OfflineURLExists(const GURL& url,
void URLDownloader::RemoveOfflineURL(const GURL& url) {
// Remove all download tasks for this url as it would be pointless work.
- tasks_.erase(
- std::remove(tasks_.begin(), tasks_.end(), std::make_pair(DOWNLOAD, url)),
- tasks_.end());
+ CancelDownloadOfflineURL(url);
tasks_.push_back(std::make_pair(DELETE, url));
HandleNextTask();
}
@@ -65,6 +63,12 @@ void URLDownloader::DownloadOfflineURL(const GURL& url) {
}
}
+void URLDownloader::CancelDownloadOfflineURL(const GURL& url) {
+ tasks_.erase(
+ std::remove(tasks_.begin(), tasks_.end(), std::make_pair(DOWNLOAD, url)),
+ tasks_.end());
+}
+
void URLDownloader::DownloadCompletionHandler(const GURL& url,
const std::string& title,
SuccessState success) {
« 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