diff options
Diffstat (limited to 'content/shell')
-rw-r--r-- | content/shell/shell_browser_context.cc | 8 | ||||
-rw-r--r-- | content/shell/shell_browser_context.h | 2 | ||||
-rw-r--r-- | content/shell/shell_download_manager_delegate.cc | 5 | ||||
-rw-r--r-- | content/shell/shell_download_manager_delegate.h | 1 | ||||
-rw-r--r-- | content/shell/shell_resource_context.cc | 8 | ||||
-rw-r--r-- | content/shell/shell_resource_context.h | 5 |
6 files changed, 11 insertions, 18 deletions
diff --git a/content/shell/shell_browser_context.cc b/content/shell/shell_browser_context.cc index 2590ee8..f6dff1e 100644 --- a/content/shell/shell_browser_context.cc +++ b/content/shell/shell_browser_context.cc @@ -12,7 +12,6 @@ #include "base/threading/thread.h" #include "content/browser/appcache/chrome_appcache_service.h" #include "content/browser/chrome_blob_storage_context.h" -#include "content/browser/download/download_id_factory.h" #include "content/browser/download/download_manager_impl.h" #include "content/browser/download/download_status_updater.h" #include "content/browser/file_system/browser_file_system_helper.h" @@ -94,8 +93,7 @@ class ShellSpeechInputPreferences : public SpeechInputPreferences { ShellBrowserContext::ShellBrowserContext( ShellBrowserMainParts* shell_main_parts) - : download_id_factory_(new DownloadIdFactory(this)), - shell_main_parts_(shell_main_parts) { + : shell_main_parts_(shell_main_parts) { } ShellBrowserContext::~ShellBrowserContext() { @@ -144,7 +142,6 @@ DownloadManager* ShellBrowserContext::GetDownloadManager() { download_manager_delegate_ = new ShellDownloadManagerDelegate(); download_manager_ = new DownloadManagerImpl(download_manager_delegate_, - download_id_factory_, download_status_updater_.get()); download_manager_delegate_->SetDownloadManager(download_manager_.get()); download_manager_->Init(this); @@ -177,8 +174,7 @@ const ResourceContext& ShellBrowserContext::GetResourceContext() { if (!resource_context_.get()) { resource_context_.reset(new ShellResourceContext( static_cast<ShellURLRequestContextGetter*>(GetRequestContext()), - GetBlobStorageContext(), - download_id_factory_)); + GetBlobStorageContext())); } return *resource_context_.get(); } diff --git a/content/shell/shell_browser_context.h b/content/shell/shell_browser_context.h index 5bf24b8..b1b8a7b 100644 --- a/content/shell/shell_browser_context.h +++ b/content/shell/shell_browser_context.h @@ -12,7 +12,6 @@ #include "base/memory/scoped_ptr.h" #include "content/public/browser/browser_context.h" -class DownloadIdFactory; class DownloadManager; class DownloadStatusUpdater; class HostZoomMap; @@ -60,7 +59,6 @@ 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_; diff --git a/content/shell/shell_download_manager_delegate.cc b/content/shell/shell_download_manager_delegate.cc index 67ff59a..7856a66 100644 --- a/content/shell/shell_download_manager_delegate.cc +++ b/content/shell/shell_download_manager_delegate.cc @@ -39,6 +39,11 @@ void ShellDownloadManagerDelegate::SetDownloadManager( void ShellDownloadManagerDelegate::Shutdown() { } +DownloadId ShellDownloadManagerDelegate::GetNextId() { + static int next_id; + return DownloadId(this, ++next_id); +} + bool ShellDownloadManagerDelegate::ShouldStartDownload(int32 download_id) { DownloadItem* download = download_manager_->GetActiveDownloadItem(download_id); diff --git a/content/shell/shell_download_manager_delegate.h b/content/shell/shell_download_manager_delegate.h index d46ac43..9cb5e97 100644 --- a/content/shell/shell_download_manager_delegate.h +++ b/content/shell/shell_download_manager_delegate.h @@ -25,6 +25,7 @@ class ShellDownloadManagerDelegate void SetDownloadManager(DownloadManager* manager); virtual void Shutdown() OVERRIDE; + virtual DownloadId GetNextId() OVERRIDE; virtual bool ShouldStartDownload(int32 download_id) OVERRIDE; virtual void ChooseDownloadPath(WebContents* web_contents, const FilePath& suggested_path, diff --git a/content/shell/shell_resource_context.cc b/content/shell/shell_resource_context.cc index 21a696f..fa725cf 100644 --- a/content/shell/shell_resource_context.cc +++ b/content/shell/shell_resource_context.cc @@ -5,18 +5,15 @@ #include "content/shell/shell_resource_context.h" #include "content/browser/chrome_blob_storage_context.h" -#include "content/browser/download/download_id_factory.h" #include "content/shell/shell_url_request_context_getter.h" namespace content { ShellResourceContext::ShellResourceContext( ShellURLRequestContextGetter* getter, - ChromeBlobStorageContext* blob_storage_context, - DownloadIdFactory* download_id_factory) + ChromeBlobStorageContext* blob_storage_context) : getter_(getter), - blob_storage_context_(blob_storage_context), - download_id_factory_(download_id_factory) { + blob_storage_context_(blob_storage_context) { } ShellResourceContext::~ShellResourceContext() { @@ -30,7 +27,6 @@ void ShellResourceContext::InitializeInternal() { set_request_context(getter_->GetURLRequestContext()); set_host_resolver(getter_->host_resolver()); set_blob_storage_context(blob_storage_context_); - set_download_id_factory(download_id_factory_); } } // namespace content diff --git a/content/shell/shell_resource_context.h b/content/shell/shell_resource_context.h index 710778e..f01a120 100644 --- a/content/shell/shell_resource_context.h +++ b/content/shell/shell_resource_context.h @@ -11,7 +11,6 @@ #include "content/browser/resource_context.h" class ChromeBlobStorageContext; -class DownloadIdFactory; namespace content { @@ -21,8 +20,7 @@ class ShellResourceContext : public content::ResourceContext { public: ShellResourceContext( ShellURLRequestContextGetter* getter, - ChromeBlobStorageContext* blob_storage_context, - DownloadIdFactory* download_id_factory); + ChromeBlobStorageContext* blob_storage_context); virtual ~ShellResourceContext(); private: @@ -32,7 +30,6 @@ class ShellResourceContext : public content::ResourceContext { scoped_refptr<ShellURLRequestContextGetter> getter_; scoped_refptr<ChromeBlobStorageContext> blob_storage_context_; - scoped_refptr<DownloadIdFactory> download_id_factory_; DISALLOW_COPY_AND_ASSIGN(ShellResourceContext); }; |