diff options
author | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 18:06:14 +0000 |
---|---|---|
committer | phajdan.jr@chromium.org <phajdan.jr@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-02 18:06:14 +0000 |
commit | 921c96d3dd14d43fff0baf3ed8c0defc4536147e (patch) | |
tree | aae845b3d5c32402d7110801107eefc58a015249 | |
parent | 42b1b76679afb3b8a7cebd1e72a7f07b2567d4a4 (diff) | |
download | chromium_src-921c96d3dd14d43fff0baf3ed8c0defc4536147e.zip chromium_src-921c96d3dd14d43fff0baf3ed8c0defc4536147e.tar.gz chromium_src-921c96d3dd14d43fff0baf3ed8c0defc4536147e.tar.bz2 |
Make sure DownloadManager is shut down on the UI thread.
This fixes a pref-related crash.
TBR=darin
BUG=54128
TEST=memory_test and others; download a file and close the browser while it's downloading; should be no DCHECKs/segfaults
Review URL: http://codereview.chromium.org/3356005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@58378 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/download/download_manager.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h index 9d2e9e1..60701e0 100644 --- a/chrome/browser/download/download_manager.h +++ b/chrome/browser/download/download_manager.h @@ -39,6 +39,7 @@ #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "base/time.h" +#include "chrome/browser/chrome_thread.h" #include "chrome/browser/shell_dialogs.h" class DownloadFileManager; @@ -54,8 +55,10 @@ struct DownloadCreateInfo; struct DownloadSaveInfo; // Browser's download manager: manages all downloads and destination view. -class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, - public SelectFileDialog::Listener { +class DownloadManager + : public base::RefCountedThreadSafe<DownloadManager, + ChromeThread::DeleteOnUIThread>, + public SelectFileDialog::Listener { // For testing. friend class DownloadManagerTest; friend class MockDownloadManager; @@ -213,7 +216,8 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>, DownloadManager* observed_download_manager_; }; - friend class base::RefCountedThreadSafe<DownloadManager>; + friend class ChromeThread; + friend class DeleteTask<DownloadManager>; friend class OtherDownloadManagerObserver; ~DownloadManager(); |