| 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 a3e72ffa469e50f0efd18f92c63a50c2a99e0e16..3cf6eadc0370f245ddd431c2a5130e20d7217d19 100644
|
| --- a/content/browser/download/download_item_impl.cc
|
| +++ b/content/browser/download/download_item_impl.cc
|
| @@ -87,8 +87,6 @@ const char* DebugDownloadStateString(DownloadItem::DownloadState state) {
|
| return "COMPLETE";
|
| case DownloadItem::CANCELLED:
|
| return "CANCELLED";
|
| - case DownloadItem::REMOVING:
|
| - return "REMOVING";
|
| case DownloadItem::INTERRUPTED:
|
| return "INTERRUPTED";
|
| default:
|
| @@ -299,8 +297,7 @@ DownloadItemImpl::DownloadItemImpl(DownloadItemImplDelegate* delegate,
|
|
|
| DownloadItemImpl::~DownloadItemImpl() {
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
| -
|
| - TransitionTo(REMOVING);
|
| + FOR_EACH_OBSERVER(Observer, observers_, OnDownloadDestroyed(this));
|
| STLDeleteContainerPairSecondPointers(
|
| external_data_map_.begin(), external_data_map_.end());
|
| delegate_->AssertStateConsistent(this);
|
| @@ -655,11 +652,15 @@ void DownloadItemImpl::Remove() {
|
| Cancel(true);
|
| delegate_->AssertStateConsistent(this);
|
|
|
| - TransitionTo(REMOVING);
|
| + NotifyRemoved();
|
| 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.
|
|
|