Index: content/browser/download/download_manager_impl.cc |
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc |
index 176ec387ecf835cbf84d569ac16da842d1c105da..990ab5552ac6bce23abd02c1f36ccba816128878 100644 |
--- a/content/browser/download/download_manager_impl.cc |
+++ b/content/browser/download/download_manager_impl.cc |
@@ -274,7 +274,8 @@ void DownloadManagerImpl::Shutdown() { |
return; |
shutdown_needed_ = false; |
- FOR_EACH_OBSERVER(Observer, observers_, ManagerGoingDown(this)); |
+ for (auto& observer : observers_) |
+ observer.ManagerGoingDown(this); |
// TODO(benjhayden): Consider clearing observers_. |
// If there are in-progress downloads, cancel them. This also goes for |
@@ -383,8 +384,10 @@ void DownloadManagerImpl::StartDownloadWithId( |
// For new downloads, we notify here, rather than earlier, so that |
// the download_file is bound to download and all the usual |
// setters (e.g. Cancel) work. |
- if (new_download) |
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download)); |
+ if (new_download) { |
+ for (auto& observer : observers_) |
+ observer.OnDownloadCreated(this, download); |
+ } |
if (!on_started.is_null()) |
on_started.Run(download, DOWNLOAD_INTERRUPT_REASON_NONE); |
@@ -460,16 +463,16 @@ void DownloadManagerImpl::CreateSavePackageDownloadItemWithId( |
downloads_[download_item->GetId()] = download_item; |
DCHECK(!base::ContainsKey(downloads_by_guid_, download_item->GetGuid())); |
downloads_by_guid_[download_item->GetGuid()] = download_item; |
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated( |
- this, download_item)); |
+ for (auto& observer : observers_) |
+ observer.OnDownloadCreated(this, download_item); |
if (!item_created.is_null()) |
item_created.Run(download_item); |
} |
void DownloadManagerImpl::OnSavePackageSuccessfullyFinished( |
DownloadItem* download_item) { |
- FOR_EACH_OBSERVER(Observer, observers_, |
- OnSavePackageSuccessfullyFinished(this, download_item)); |
+ for (auto& observer : observers_) |
+ observer.OnSavePackageSuccessfullyFinished(this, download_item); |
} |
// Resume a download of a specific URL. We send the request to the |
@@ -705,7 +708,8 @@ DownloadItem* DownloadManagerImpl::CreateDownloadItem( |
net::NetLogWithSource::Make(net_log_, net::NetLogSourceType::DOWNLOAD)); |
downloads_[id] = item; |
downloads_by_guid_[guid] = item; |
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, item)); |
+ for (auto& observer : observers_) |
+ observer.OnDownloadCreated(this, item); |
DVLOG(20) << __func__ << "() download = " << item->DebugString(true); |
return item; |
} |