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

Unified Diff: content/browser/download/download_item_impl.cc

Issue 2422923002: Reduce usage of FOR_EACH_OBSERVER macro in content/browser (Closed)
Patch Set: skip cases in 2418143004 and 2418373002 Created 4 years, 2 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: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 99baf7e8c20019cdd3100f72573ce98b62ba2a75..f2494eb3fc479ad88b90c3c71d59901c646be2cd 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -246,7 +246,8 @@ DownloadItemImpl::~DownloadItemImpl() {
// DownloadManager shutdown.
DCHECK(!download_file_.get());
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadDestroyed(this));
+ for (auto& observer : observers_)
+ observer.OnDownloadDestroyed(this);
delegate_->AssertStateConsistent(this);
delegate_->Detach();
}
@@ -267,7 +268,8 @@ void DownloadItemImpl::UpdateObservers() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DVLOG(20) << __func__ << "()";
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadUpdated(this));
+ for (auto& observer : observers_)
+ observer.OnDownloadUpdated(this);
}
void DownloadItemImpl::ValidateDangerousDownload() {
@@ -428,7 +430,8 @@ void DownloadItemImpl::OpenDownload() {
delegate_->CheckForFileRemoval(this);
RecordOpen(GetEndTime(), !GetOpened());
opened_ = true;
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadOpened(this));
+ for (auto& observer : observers_)
+ observer.OnDownloadOpened(this);
delegate_->OpenDownload(this);
}
@@ -974,7 +977,8 @@ void DownloadItemImpl::UpdateValidatorsOnResumption(
}
void DownloadItemImpl::NotifyRemoved() {
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadRemoved(this));
+ for (auto& observer : observers_)
+ observer.OnDownloadRemoved(this);
}
void DownloadItemImpl::OnDownloadedFileRemoved() {
« no previous file with comments | « content/browser/dom_storage/dom_storage_context_impl.cc ('k') | content/browser/download/download_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698