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

Unified Diff: content/browser/browser_context.cc

Issue 10344024: Rewrite download manager unit to be actual unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR. 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
« no previous file with comments | « no previous file | content/browser/download/download_item_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 17e60d969b96ff3774345e9e3d40ba8d139e4d36..522ccd108edc29658a73f380f2713a33e3b10a37 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -6,9 +6,11 @@
#include "content/browser/appcache/chrome_appcache_service.h"
#include "content/browser/dom_storage/dom_storage_context_impl.h"
+#include "content/browser/download/download_file_manager.h"
#include "content/browser/download/download_manager_impl.h"
#include "content/browser/fileapi/browser_file_system_helper.h"
#include "content/browser/in_process_webkit/indexed_db_context_impl.h"
+#include "content/browser/renderer_host/resource_dispatcher_host_impl.h"
#include "content/browser/resource_context_impl.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/content_browser_client.h"
@@ -75,7 +77,7 @@ void CreateQuotaManagerAndClients(BrowserContext* context) {
context->GetPath(), context->IsOffTheRecord(),
context->GetSpecialStoragePolicy(), quota_manager->proxy(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE));
- context->SetUserData(kDatabaseTrackerKeyName,
+ context->SetUserData(kDatabaseTrackerKeyName,
new UserDataAdapter<DatabaseTracker>(db_tracker));
FilePath path = context->IsOffTheRecord() ? FilePath() : context->GetPath();
@@ -142,8 +144,16 @@ DOMStorageContextImpl* GetDOMStorageContextImpl(BrowserContext* context) {
DownloadManager* BrowserContext::GetDownloadManager(
BrowserContext* context) {
if (!context->GetUserData(kDownloadManagerKeyName)) {
- scoped_refptr<DownloadManager> download_manager = new DownloadManagerImpl(
- GetContentClient()->browser()->GetNetLog());
+ ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
+ DCHECK(rdh);
+ DownloadFileManager* file_manager = rdh->download_file_manager();
+ DCHECK(file_manager);
+ scoped_refptr<DownloadManager> download_manager =
+ new DownloadManagerImpl(
+ file_manager,
+ scoped_ptr<DownloadItemFactory>(),
+ GetContentClient()->browser()->GetNetLog());
+
context->SetUserData(
kDownloadManagerKeyName,
new UserDataAdapter<DownloadManager>(download_manager));
« no previous file with comments | « no previous file | content/browser/download/download_item_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698