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

Unified Diff: content/browser/browser_context.cc

Issue 15701007: BrowserContext should simply own DownloadManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 7 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
Index: content/browser/browser_context.cc
diff --git a/content/browser/browser_context.cc b/content/browser/browser_context.cc
index 45e5ca9c5e953e80c4aa55762a5a8757feb11a14..5faa872cc6372f68668ba760346fa87c4703989b 100644
--- a/content/browser/browser_context.cc
+++ b/content/browser/browser_context.cc
@@ -156,18 +156,18 @@ DownloadManager* BrowserContext::GetDownloadManager(
if (!context->GetUserData(kDownloadManagerKeyName)) {
ResourceDispatcherHostImpl* rdh = ResourceDispatcherHostImpl::Get();
DCHECK(rdh);
- scoped_refptr<DownloadManager> download_manager =
+ DownloadManager* download_manager =
new DownloadManagerImpl(
GetContentClient()->browser()->GetNetLog(), context);
context->SetUserData(
kDownloadManagerKeyName,
- new UserDataAdapter<DownloadManager>(download_manager));
+ download_manager);
download_manager->SetDelegate(context->GetDownloadManagerDelegate());
}
- return UserDataAdapter<DownloadManager>::Get(
- context, kDownloadManagerKeyName);
+ return static_cast<DownloadManager*>(
+ context->GetUserData(kDownloadManagerKeyName));
}
// static

Powered by Google App Engine
This is Rietveld 408576698