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

Side by Side Diff: content/shell/shell_browser_context.cc

Issue 8351052: Created a DownloadManager interface, for use in unit tests.. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created a non-inlined destructor for MockDownloadManager. Created 9 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/shell/shell_browser_context.h" 5 #include "content/shell/shell_browser_context.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "content/browser/appcache/chrome_appcache_service.h" 10 #include "content/browser/appcache/chrome_appcache_service.h"
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 if (!ssl_host_state_.get()) 119 if (!ssl_host_state_.get())
120 ssl_host_state_.reset(new SSLHostState()); 120 ssl_host_state_.reset(new SSLHostState());
121 return ssl_host_state_.get(); 121 return ssl_host_state_.get();
122 } 122 }
123 123
124 DownloadManager* ShellBrowserContext::GetDownloadManager() { 124 DownloadManager* ShellBrowserContext::GetDownloadManager() {
125 if (!download_manager_.get()) { 125 if (!download_manager_.get()) {
126 download_status_updater_.reset(new DownloadStatusUpdater()); 126 download_status_updater_.reset(new DownloadStatusUpdater());
127 127
128 download_manager_delegate_ = new ShellDownloadManagerDelegate(); 128 download_manager_delegate_ = new ShellDownloadManagerDelegate();
129 download_manager_ = new DownloadManager(download_manager_delegate_, 129 download_manager_ = new DownloadManagerImpl(download_manager_delegate_,
130 download_id_factory_, 130 download_id_factory_,
131 download_status_updater_.get()); 131 download_status_updater_.get());
132 download_manager_delegate_->SetDownloadManager(download_manager_.get()); 132 download_manager_delegate_->SetDownloadManager(download_manager_.get());
133 download_manager_->Init(this); 133 download_manager_->Init(this);
134 } 134 }
135 return download_manager_.get(); 135 return download_manager_.get();
136 } 136 }
137 137
138 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() { 138 net::URLRequestContextGetter* ShellBrowserContext::GetRequestContext() {
139 if (!url_request_getter_) { 139 if (!url_request_getter_) {
140 url_request_getter_ = new ShellURLRequestContextGetter( 140 url_request_getter_ = new ShellURLRequestContextGetter(
141 GetPath(), 141 GetPath(),
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 NewRunnableMethod( 253 NewRunnableMethod(
254 appcache_service_.get(), 254 appcache_service_.get(),
255 &ChromeAppCacheService::InitializeOnIOThread, 255 &ChromeAppCacheService::InitializeOnIOThread,
256 IsOffTheRecord() 256 IsOffTheRecord()
257 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")), 257 ? FilePath() : GetPath().Append(FILE_PATH_LITERAL("AppCache")),
258 &GetResourceContext(), 258 &GetResourceContext(),
259 special_storage_policy)); 259 special_storage_policy));
260 } 260 }
261 261
262 } // namespace content 262 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698