Index: content/browser/download/download_manager_impl.cc |
=================================================================== |
--- content/browser/download/download_manager_impl.cc (revision 116798) |
+++ content/browser/download/download_manager_impl.cc (working copy) |
@@ -76,6 +76,18 @@ |
} // namespace |
+namespace content { |
+ |
+// static |
+DownloadManager* DownloadManager::Create( |
+ content::DownloadManagerDelegate* delegate, |
+ DownloadIdFactory* id_factory, |
+ DownloadStatusUpdater* status_updater) { |
+ return new DownloadManagerImpl(delegate, id_factory, status_updater); |
+} |
+ |
+} // namespace content |
+ |
DownloadManagerImpl::DownloadManagerImpl( |
content::DownloadManagerDelegate* delegate, |
DownloadIdFactory* id_factory, |
@@ -234,15 +246,8 @@ |
browser_context_ = browser_context; |
- // In test mode, there may be no ResourceDispatcherHost. In this case it's |
- // safe to avoid setting |file_manager_| because we only call a small set of |
- // functions, none of which need it. |
- ResourceDispatcherHost* rdh = |
- content::GetContentClient()->browser()->GetResourceDispatcherHost(); |
- if (rdh) { |
- file_manager_ = rdh->download_file_manager(); |
- DCHECK(file_manager_); |
- } |
+ file_manager_ = ResourceDispatcherHost::Get()->download_file_manager(); |
+ DCHECK(file_manager_); |
return true; |
} |
@@ -771,7 +776,7 @@ |
const DownloadSaveInfo& save_info, |
WebContents* web_contents) { |
ResourceDispatcherHost* resource_dispatcher_host = |
- content::GetContentClient()->browser()->GetResourceDispatcherHost(); |
+ ResourceDispatcherHost::Get(); |
// We send a pointer to content::ResourceContext, instead of the usual |
// reference, so that a copy of the object isn't made. |