diff options
author | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 00:58:58 +0000 |
---|---|---|
committer | paulg@google.com <paulg@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-30 00:58:58 +0000 |
commit | a6604d90563ed00e56d4ffe5116d3c7726a893f9 (patch) | |
tree | 1e1cd7874a1694502d07faf7f2a987565ea41b9e /chrome/browser | |
parent | 282e2f7d5da27717e6fe05abd482237db0019e01 (diff) | |
download | chromium_src-a6604d90563ed00e56d4ffe5116d3c7726a893f9.zip chromium_src-a6604d90563ed00e56d4ffe5116d3c7726a893f9.tar.gz chromium_src-a6604d90563ed00e56d4ffe5116d3c7726a893f9.tar.bz2 |
Remove downloads from the completed dangerous downloads list
when they are deleted via "Clear browsing data".
There was definite crash a shutdown, and sporadic crashes when
idling (but after a dangerous download was complete but not yet
confirmed) after a user cleared their browsing data, since the
dangerous list kept around a pointer to a download that had
been deleted elsewhere.
BUG=3498 (http://code.google.com/p/chromium/issues/detail?id=3498)
Review URL: http://codereview.chromium.org/8728
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4200 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/download/download_manager.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 8e10b86..ed4ebb0 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -975,6 +975,12 @@ int DownloadManager::RemoveDownloadsBetween(const Time remove_begin, state == DownloadItem::CANCELLED)) { // Remove from the map and move to the next in the list. it = downloads_.erase(it); + + // Also remove it from any completed dangerous downloads. + DownloadMap::iterator dit = dangerous_finished_.find(download->id()); + if (dit != dangerous_finished_.end()) + dangerous_finished_.erase(dit); + delete download; ++num_deleted; |