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

Unified Diff: content/browser/browser_context.cc

Issue 14593012: 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 b32b58a2b5634cc44f4d889666613e56bf7b4982..ec029518f1b5e5dffd5696b9bf29a1804640ddc9 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