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

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

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.h
diff --git a/content/browser/download/download_file_manager.h b/content/browser/download/download_file_manager.h
index da86124439a1ca6bb6d83df209afe3b6addb17a3..12767d06bdd88d7e670c7684fb8176cbf0897a7c 100644
--- a/content/browser/download/download_file_manager.h
+++ b/content/browser/download/download_file_manager.h
@@ -47,6 +47,7 @@
#include "base/gtest_prod_util.h"
#include "base/hash_tables.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/timer.h"
#include "content/browser/download/download_id.h"
#include "content/browser/download/interrupt_reasons.h"
@@ -69,7 +70,21 @@ class DownloadBuffer;
class CONTENT_EXPORT DownloadFileManager
: public base::RefCountedThreadSafe<DownloadFileManager> {
public:
- explicit DownloadFileManager(ResourceDispatcherHost* rdh);
+ class DownloadFileFactory {
+ public:
+ virtual ~DownloadFileFactory() {}
+
+ virtual DownloadFile* CreateFile(
+ DownloadCreateInfo* info,
+ const DownloadRequestHandle& request_handle,
+ DownloadManager* download_manager) = 0;
+ };
+
+ // Takes ownership of the factory.
+ // Passing in a NULL for |factory| will cause the default
Randy Smith (Not in Mondays) 2011/12/07 20:57:41 nit: "the" to "a", since we're talking about objec
ahendrickson 2011/12/07 21:11:17 Done.
+ // |DownloadFileFactory| to be used.
+ DownloadFileManager(ResourceDispatcherHost* rdh,
+ DownloadFileFactory* factory);
// Called on shutdown on the UI thread.
void Shutdown();
@@ -165,6 +180,7 @@ class CONTENT_EXPORT DownloadFileManager
base::RepeatingTimer<DownloadFileManager> update_timer_;
ResourceDispatcherHost* resource_dispatcher_host_;
+ scoped_ptr<DownloadFileFactory> download_file_factory_;
DISALLOW_COPY_AND_ASSIGN(DownloadFileManager);
};

Powered by Google App Engine
This is Rietveld 408576698