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

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

Issue 10837125: Revert 149794 - DownloadItem::Observer::OnDownloadDestroyed() replaces DownloadItem::REMOVING (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1228/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/browser/download/download_item_impl.cc
===================================================================
--- content/browser/download/download_item_impl.cc (revision 150095)
+++ content/browser/download/download_item_impl.cc (working copy)
@@ -87,6 +87,8 @@
return "COMPLETE";
case DownloadItem::CANCELLED:
return "CANCELLED";
+ case DownloadItem::REMOVING:
+ return "REMOVING";
case DownloadItem::INTERRUPTED:
return "INTERRUPTED";
default:
@@ -297,7 +299,8 @@
DownloadItemImpl::~DownloadItemImpl() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadDestroyed(this));
+
+ TransitionTo(REMOVING);
STLDeleteContainerPairSecondPointers(
external_data_map_.begin(), external_data_map_.end());
delegate_->AssertStateConsistent(this);
@@ -651,15 +654,11 @@
Cancel(true);
delegate_->AssertStateConsistent(this);
- NotifyRemoved();
+ TransitionTo(REMOVING);
delegate_->DownloadRemoved(this);
// We have now been deleted.
}
-void DownloadItemImpl::NotifyRemoved() {
- FOR_EACH_OBSERVER(Observer, observers_, OnDownloadRemoved(this));
-}
-
bool DownloadItemImpl::TimeRemaining(base::TimeDelta* remaining) const {
if (total_bytes_ <= 0)
return false; // We never received the content_length for this download.
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698