Index: chrome/browser/download/download_item.cc |
diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc |
index 72e89b53551f587d29ca578bfb803b1d21238cff..b197e43e9ed245fbb9190fe0ffd3ac569756d004 100644 |
--- a/chrome/browser/download/download_item.cc |
+++ b/chrome/browser/download/download_item.cc |
@@ -532,9 +532,31 @@ void DownloadItem::Remove() { |
// TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved. |
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
- download_manager_->AssertQueueStateConsistent(this); |
+ // TODO(haraken): The following AssertQueueStateConsistent() fails |
+ // if this Remove() is called after download_manager_->StartDownload() |
+ // but before download_manager_->ContinueDownloadWithPath(). |
+ // In that case, download->state_ is IN_PROGRESS but the download id |
+ // is not yet registered to download_manager_->in_progress_. |
+ // This violates 'CHECK(ContainsKey(in_progress_, download->id()) == |
+ // (download->state() == DownloadItem::IN_PROGRESS));' |
+ // in AssertQueueStateConsistent(). |
+ // |
+ // download_manager_->AssertQueueStateConsistent(this); |
+ |
haraken1
2011/06/22 18:01:58
In fact, DownloadManagerTest.StartDownload fails a
Randy Smith (Not in Mondays)
2011/06/23 20:24:42
Based on your description, it sounds as if if we c
haraken1
2011/06/24 01:57:25
I reverted this code back to the original, since I
|
Cancel(true); |
- download_manager_->AssertQueueStateConsistent(this); |
+ |
+ // TODO(haraken): The following AssertQueueStateConsistent() fails |
+ // if this Remove() is called after download_manager_->StartDownload() |
+ // but before download_manager_->ContinueDownloadWithPath(). |
+ // In that case, since the download id is not yet registered to |
+ // download_manager_->in_progress_, download_manager_->DownloadCancelled() |
+ // called inside the above Cancel() returns immediately without |
+ // clearing download_manager_->active_downloads_. Then, this violates |
+ // 'CHECK(ContainsKey(active_downloads_, download->id()) == |
+ // (download->state() == DownloadItem::IN_PROGRESS));' |
+ // in AssertQueueStateConsistent(). |
+ // |
+ // download_manager_->AssertQueueStateConsistent(this); |
state_ = REMOVING; |
download_manager_->RemoveDownload(db_handle_); |