summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_service.h
diff options
context:
space:
mode:
authorasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 20:10:41 +0000
committerasanka@chromium.org <asanka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-12-13 20:10:41 +0000
commit861b4d0a0b0cf9e5224d004eb99ce768221000ed (patch)
treee9c9b7e92a8ca67ed805e74cf6fd43a9619f9242 /chrome/browser/download/download_service.h
parent163a0dd59f459e0c25067b14e8e0620bb18039f8 (diff)
downloadchromium_src-861b4d0a0b0cf9e5224d004eb99ce768221000ed.zip
chromium_src-861b4d0a0b0cf9e5224d004eb99ce768221000ed.tar.gz
chromium_src-861b4d0a0b0cf9e5224d004eb99ce768221000ed.tar.bz2
[Downloads] Make ChromeDownloadManagerDelegate owned by DownloadService.
Currently ChromeDownloadManagerDelegate is reference counted. Since it also posts long running tasks, this causes it to outlive the associated profile on occasion. Since there are multiple references to Profile/BrowserContext owned objects from within CDMD, this can introduce subtle use-after-free errors. This change is to make CDMD owned by DownloadService so that it doesn't outlive the Profile. BUG=317913 Review URL: https://codereview.chromium.org/69793006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@240726 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_service.h')
-rw-r--r--chrome/browser/download/download_service.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/chrome/browser/download/download_service.h b/chrome/browser/download/download_service.h
index c382486..72b0de0 100644
--- a/chrome/browser/download/download_service.h
+++ b/chrome/browser/download/download_service.h
@@ -7,7 +7,6 @@
#include "base/basictypes.h"
#include "base/callback_forward.h"
-#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
@@ -58,7 +57,7 @@ class DownloadService : public BrowserContextKeyedService {
// its DownloadManager. Takes ownership of |delegate|, and destroys
// the previous delegate. For testing.
void SetDownloadManagerDelegateForTesting(
- ChromeDownloadManagerDelegate* delegate);
+ scoped_ptr<ChromeDownloadManagerDelegate> delegate);
// Will be called to release references on other services as part
// of Profile shutdown.
@@ -75,7 +74,7 @@ class DownloadService : public BrowserContextKeyedService {
// ChromeDownloadManagerDelegate may be the target of callbacks from
// the history service/DB thread and must be kept alive for those
// callbacks.
- scoped_refptr<ChromeDownloadManagerDelegate> manager_delegate_;
+ scoped_ptr<ChromeDownloadManagerDelegate> manager_delegate_;
scoped_ptr<DownloadHistory> download_history_;