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

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

Issue 10735089: DownloadManager::Observer::OnDownloadCreated (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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_manager_impl.cc
diff --git a/content/browser/download/download_manager_impl.cc b/content/browser/download/download_manager_impl.cc
index 7570379eae814d624bfda65aab7759e8e965baef..3afe203e4bf325d4a51f484df790e1d697eb92dd 100644
--- a/content/browser/download/download_manager_impl.cc
+++ b/content/browser/download/download_manager_impl.cc
@@ -534,6 +534,7 @@ net::BoundNetLog DownloadManagerImpl::CreateDownloadItem(
downloads_[download->GetId()] = download;
DCHECK(!ContainsKey(active_downloads_, download->GetId()));
active_downloads_[download->GetId()] = download;
+ FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download));
return bound_net_log;
}
@@ -563,6 +564,8 @@ DownloadItemImpl* DownloadManagerImpl::CreateSavePackageDownloadItem(
new SavePageExternalData(download);
DCHECK(SavePageExternalData::Get(download));
Randy Smith (Not in Mondays) 2012/07/19 17:25:36 small nit: It seems like whether or not there's ve
benjhayden 2012/07/23 15:58:42 I think that whitespace is more context-dependent
+ FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download));
+
// Will notify the observer in the callback.
if (delegate_)
delegate_->AddItemToPersistentStore(download);
@@ -947,6 +950,7 @@ void DownloadManagerImpl::OnPersistentStoreQueryComplete(
this, GetNextId(), entries->at(i), bound_net_log);
DCHECK(!ContainsKey(downloads_, download->GetId()));
downloads_[download->GetId()] = download;
+ FOR_EACH_OBSERVER(Observer, observers_, OnDownloadCreated(this, download));
VLOG(20) << __FUNCTION__ << "()" << i << ">"
<< " download = " << download->DebugString(true);
}

Powered by Google App Engine
This is Rietveld 408576698