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

Unified Diff: content/browser/renderer_host/resource_dispatcher_host.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/renderer_host/resource_dispatcher_host.cc
diff --git a/content/browser/renderer_host/resource_dispatcher_host.cc b/content/browser/renderer_host/resource_dispatcher_host.cc
index fb0f1c33e0108169ae32d8423f1e4cc823466d0b..536c09e71bd68fb917cda8eb733bf51274999a10 100644
--- a/content/browser/renderer_host/resource_dispatcher_host.cc
+++ b/content/browser/renderer_host/resource_dispatcher_host.cc
@@ -27,6 +27,7 @@
#include "content/browser/chrome_blob_storage_context.h"
#include "content/browser/cross_site_request_manager.h"
#include "content/browser/download/download_file_manager.h"
+#include "content/browser/download/download_file_impl.h"
#include "content/browser/download/download_id_factory.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/download/download_resource_handler.h"
@@ -119,6 +120,25 @@ const int kAllNetErrorCodes[] = {
#undef NET_ERROR
};
+class StandardDownloadFileFactory
Randy Smith (Not in Mondays) 2011/12/05 22:25:38 I don't think this belongs in ResourceDispatcherHo
cbentzel 2011/12/07 18:58:21 I agree that the definition doesn't belong in RDH.
ahendrickson 2011/12/07 19:55:15 I like option 3. Done.
ahendrickson 2011/12/07 19:55:15 Renamed, and moved into DownloadFileManager.cc. U
+ : public DownloadFileManager::DownloadFileFactory {
+ public:
+ StandardDownloadFileFactory() {}
+
+ virtual DownloadFile* GetFile(DownloadCreateInfo* info,
+ const DownloadRequestHandle& request_handle,
+ DownloadManager* download_manager) OVERRIDE;
+};
+
+DownloadFile* StandardDownloadFileFactory::GetFile(
+ DownloadCreateInfo* info,
+ const DownloadRequestHandle& request_handle,
+ DownloadManager* download_manager) {
+ return new DownloadFileImpl(info,
+ new DownloadRequestHandle(request_handle),
+ download_manager);
+}
+
// Aborts a request before an URLRequest has actually been created.
void AbortRequestBeforeItStarts(ResourceMessageFilter* filter,
IPC::Message* sync_result,
@@ -292,7 +312,9 @@ void OnSwapOutACKHelper(int render_process_id, int render_view_id) {
ResourceDispatcherHost::ResourceDispatcherHost(
const ResourceQueue::DelegateSet& resource_queue_delegates)
: ALLOW_THIS_IN_INITIALIZER_LIST(
- download_file_manager_(new DownloadFileManager(this))),
+ download_file_manager_(new DownloadFileManager(
+ this,
+ new StandardDownloadFileFactory))),
ALLOW_THIS_IN_INITIALIZER_LIST(
save_file_manager_(new SaveFileManager(this))),
request_id_(-1),

Powered by Google App Engine
This is Rietveld 408576698