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

Unified Diff: content/browser/download/download_file_manager.cc

Issue 8770024: Added a download file factory to the download file manager, for testing. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Merged with trunk. Created 9 years 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/download/download_file_manager.cc
diff --git a/content/browser/download/download_file_manager.cc b/content/browser/download/download_file_manager.cc
index 0a5f5e964ae664342d0333c816ddeebdd391cd73..8dcc655dfd3ab78039fa4ef8362f620ebee9476c 100644
--- a/content/browser/download/download_file_manager.cc
+++ b/content/browser/download/download_file_manager.cc
@@ -36,8 +36,9 @@ const int kUpdatePeriodMs = 500;
} // namespace
-DownloadFileManager::DownloadFileManager(ResourceDispatcherHost* rdh)
- : resource_dispatcher_host_(rdh) {
+DownloadFileManager::DownloadFileManager(ResourceDispatcherHost* rdh,
+ DownloadFileFactory* factory)
+ : resource_dispatcher_host_(rdh), download_file_factory_(factory) {
cbentzel 2011/12/07 18:58:21 Should DCHECK here that both rdh and factory are n
ahendrickson 2011/12/07 19:55:15 rdh is allowed to be NULL. If |factory| is NULL,
}
DownloadFileManager::~DownloadFileManager() {
@@ -68,9 +69,7 @@ void DownloadFileManager::CreateDownloadFile(
scoped_ptr<DownloadCreateInfo> infop(info);
scoped_ptr<DownloadFile> download_file(
- new DownloadFileImpl(info,
- new DownloadRequestHandle(request_handle),
- download_manager));
+ download_file_factory_->GetFile(info, request_handle, download_manager));
cbentzel 2011/12/07 18:58:21 that one unit test passes in a NULL DownloadFileFa
ahendrickson 2011/12/07 19:55:15 Done.
if (net::OK != download_file->Initialize(get_hash)) {
request_handle.CancelRequest();
return;

Powered by Google App Engine
This is Rietveld 408576698