summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_manager.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download/download_manager.cc')
-rw-r--r--chrome/browser/download/download_manager.cc11
1 files changed, 5 insertions, 6 deletions
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 266767b..d1ec883 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -73,12 +73,9 @@ DownloadManager::~DownloadManager() {
void DownloadManager::Shutdown() {
DCHECK(shutdown_needed_) << "Shutdown called when not needed.";
- if (file_manager_) {
- ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
- NewRunnableMethod(file_manager_,
- &DownloadFileManager::OnDownloadManagerShutdown,
- this));
- }
+ // Stop receiving download updates
+ if (file_manager_)
+ file_manager_->RemoveDownloadManager(this);
// 'in_progress_' may contain DownloadItems that have not finished the start
// complete (from the history service) and thus aren't in downloads_.
@@ -664,6 +661,8 @@ void DownloadManager::DownloadCancelledInternal(int download_id,
render_process_id,
request_id));
+ // Tell the file manager to cancel the download.
+ file_manager_->RemoveDownload(download_id, this); // On the UI thread
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(