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

Unified Diff: chrome/browser/download/download_item.cc

Issue 6973052: When the download folder does not exist, change the download folder to a user's "Downloads" (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Remove DownloadTest.DownloadFolder2 and SavePageBrowserTest.SaveFolder4 Created 9 years, 6 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
« no previous file with comments | « chrome/browser/download/download_file_unittest.cc ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_);
« no previous file with comments | « chrome/browser/download/download_file_unittest.cc ('k') | chrome/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698