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

Unified Diff: content/public/test/download_test_observer.cc

Issue 10665049: Make DownloadHistory observe manager, items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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/public/test/download_test_observer.cc
diff --git a/content/public/test/download_test_observer.cc b/content/public/test/download_test_observer.cc
index c802b50e0d6ad5838814eb84439ff8815a40510d..49fe7b92a37b1eaed2c6264ee671772d79df6e76 100644
--- a/content/public/test/download_test_observer.cc
+++ b/content/public/test/download_test_observer.cc
@@ -131,6 +131,12 @@ void DownloadTestObserver::OnDownloadUpdated(DownloadItem* download) {
DownloadInFinalState(download);
}
+void DownloadTestObserver::OnDownloadCreated(
+ DownloadManager* manager, DownloadItem* item) {
+ item->AddObserver(this);
+ downloads_observed_.insert(item);
Randy Smith (Not in Mondays) 2012/08/28 13:11:49 Why the addition? I don't mind changing over, but
benjhayden 2012/09/10 19:02:56 Done.
+}
+
void DownloadTestObserver::ModelChanged(DownloadManager* manager) {
DCHECK_EQ(manager, download_manager_);
@@ -151,6 +157,7 @@ void DownloadTestObserver::ModelChanged(DownloadManager* manager) {
DownloadSet::iterator observed_it(downloads_observed_.find(*it));
// If it isn't finished and we're aren't observing it, start.
+ // Usually, OnDownloadCreated should have started observing it.
if (finished_it == finished_downloads_.end() &&
observed_it == downloads_observed_.end()) {
(*it)->AddObserver(this);

Powered by Google App Engine
This is Rietveld 408576698