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

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

Issue 8804018: Delay DownloadManager creation by adding a callback queue to DownloadService (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: comments Created 9 years 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
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | chrome/browser/download/download_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_service.h
diff --git a/chrome/browser/download/download_service.h b/chrome/browser/download/download_service.h
index 2317de1a92bf7b374874c72e6d641b02575f3455..41f659b8c09841780477b5270e80efacf1b8f3c0 100644
--- a/chrome/browser/download/download_service.h
+++ b/chrome/browser/download/download_service.h
@@ -6,7 +6,10 @@
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SERVICE_H_
#pragma once
+#include <vector>
+
#include "base/basictypes.h"
+#include "base/callback_forward.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "chrome/browser/profiles/profile_keyed_service.h"
@@ -25,6 +28,10 @@ class DownloadService : public ProfileKeyedService {
DownloadIdFactory* GetDownloadIdFactory() const;
+ // Register a callback to be called whenever the DownloadManager is created.
+ typedef base::Callback<void(DownloadManager*)> OnManagerCreatedCallback;
+ void OnManagerCreated(const OnManagerCreatedCallback& cb);
+
// Get the download manager. Creates the download manager if
// it does not already exist.
DownloadManager* GetDownloadManager();
@@ -64,6 +71,8 @@ class DownloadService : public ProfileKeyedService {
scoped_refptr<DownloadManager> manager_;
scoped_refptr<ChromeDownloadManagerDelegate> manager_delegate_;
+ std::vector<OnManagerCreatedCallback> on_manager_created_callbacks_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadService);
};
« no previous file with comments | « chrome/browser/download/download_extension_api.cc ('k') | chrome/browser/download/download_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698