summaryrefslogtreecommitdiffstats
path: root/content/shell/shell_browser_context.h
diff options
context:
space:
mode:
authorbenjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-29 00:46:53 +0000
committerbenjhayden@chromium.org <benjhayden@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-29 00:46:53 +0000
commit2909e34853b862eb037ff68891af80b749073274 (patch)
tree43d5959a44bf7ced269f53769d2d9cf53e17d7a8 /content/shell/shell_browser_context.h
parente3b140eae1c14a6b76dedf0d5b7d9dd3c40af895 (diff)
downloadchromium_src-2909e34853b862eb037ff68891af80b749073274.zip
chromium_src-2909e34853b862eb037ff68891af80b749073274.tar.gz
chromium_src-2909e34853b862eb037ff68891af80b749073274.tar.bz2
Fix history importing by delaying DownloadManager creation. Replace GetNextIdThunkType with DownloadIdFactory (RefCountedThreadSafe, created by DownloadService).
DownloadService uses the same DownloadIdFactory for an OTR profile as its original profile. DownloadService passes the DownloadIdFactory into the DownloadManager so that the DownloadManager can allocate new valid ids for items loaded from the history or downloads started on the ui thread. Since the DownloadService precedes and outlives its DownloadManager, DownloadManager does not have a scoped_refptr<DownloadIdFactory>. Objects that do have a scoped_refptr<DownloadIdFactory>: DownloadService, ProfileIOData, ShellBrowserContext, ShellResourceContext. The DownloadIdFactory must be RefCountedThreadSafe because ProfileIOData outlives Profile and because it's used in both the OTR and original profiles. Longer term, the import process should strictly precede profile initialization, and the next_download_id counter should be loaded from the History db strictly before DownloadService is created and creates a DownloadIdFactory. BUG=98966 Review URL: http://codereview.chromium.org/8401001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107836 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/shell/shell_browser_context.h')
-rw-r--r--content/shell/shell_browser_context.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h
index c6471ee..55ee135 100644
--- a/content/shell/shell_browser_context.h
+++ b/content/shell/shell_browser_context.h
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "content/browser/browser_context.h"
+class DownloadIdFactory;
class DownloadManager;
class DownloadStatusUpdater;
class GeolocationPermissionContext;
@@ -60,6 +61,7 @@ class ShellBrowserContext : public BrowserContext {
scoped_ptr<SSLHostState> ssl_host_state_;
scoped_ptr<DownloadStatusUpdater> download_status_updater_;
scoped_refptr<ShellDownloadManagerDelegate> download_manager_delegate_;
+ scoped_refptr<DownloadIdFactory> download_id_factory_;
scoped_refptr<DownloadManager> download_manager_;
scoped_refptr<net::URLRequestContextGetter> url_request_getter_;
scoped_refptr<HostZoomMap> host_zoom_map_;