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

Unified Diff: chrome/browser/download/download_service.h

Issue 10535026: Move creation and ownership of DownloadManager from the embedder to content. This matches all the o… (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix cros compile Created 8 years, 6 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
Index: chrome/browser/download/download_service.h
===================================================================
--- chrome/browser/download/download_service.h (revision 140592)
+++ chrome/browser/download/download_service.h (working copy)
@@ -18,10 +18,10 @@
namespace content {
class DownloadManager;
+class DownloadManagerDelegate;
}
-// Owning class for DownloadManager (content) and
-// ChromeDownloadManagerDelegate (chrome)
+// Owning class for ChromeDownloadManagerDelegate.
class DownloadService : public ProfileKeyedService {
public:
explicit DownloadService(Profile* profile);
@@ -32,11 +32,10 @@
OnManagerCreatedCallback;
void OnManagerCreated(const OnManagerCreatedCallback& cb);
- // Get the download manager. Creates the download manager if
- // it does not already exist.
- content::DownloadManager* GetDownloadManager();
+ // Get the download manager delegate, creating it if it doesn't already exist.
+ content::DownloadManagerDelegate* GetDownloadManagerDelegate();
- // Has a download manager been created? (By calling above function.)
+ // Has a download manager been created?
bool HasCreatedDownloadManager();
// Number of downloads associated with this instance of the service.
@@ -59,14 +58,9 @@
bool download_manager_created_;
Profile* profile_;
- // Both of these objects are owned by this class.
- // DownloadManager is RefCountedThreadSafe because of references
- // from DownloadFile objects on the FILE thread, and may need to be
- // kept alive until those objects are deleted.
// ChromeDownloadManagerDelegate may be the target of callbacks from
// the history service/DB thread and must be kept alive for those
// callbacks.
- scoped_refptr<content::DownloadManager> manager_;
scoped_refptr<ChromeDownloadManagerDelegate> manager_delegate_;
std::vector<OnManagerCreatedCallback> on_manager_created_callbacks_;

Powered by Google App Engine
This is Rietveld 408576698