| 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.
|
|
|