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

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

Issue 6327016: Check for cancel in DownloadManager::OnAllDataSaved(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 7e66e505b7737a6b4a1af48844c9e8d89c58a0f2..affdf947b6a3232b085f8c40c753337c7a4b691e 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -509,7 +509,11 @@ void DownloadManager::OnAllDataSaved(int32 download_id, int64 size) {
VLOG(20) << __FUNCTION__ << "()" << " download_id = " << download_id
<< " size = " << size;
- DCHECK_EQ(1U, active_downloads_.count(download_id));
+ // If it's not in active_downloads_, that means it was cancelled; just
Paweł Hajdan Jr. 2011/01/25 07:27:46 How about removing the download from active_downlo
+ // ignore the notification.
+ if (active_downloads_.count(download_id) == 0)
+ return;
+
DownloadItem* download = active_downloads_[download_id];
download->OnAllDataSaved(size);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698