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

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

Issue 10344024: Rewrite download manager unit to be actual unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR. Created 8 years, 6 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
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item_factory.h
diff --git a/content/browser/download/download_item_factory.h b/content/browser/download/download_item_factory.h
new file mode 100644
index 0000000000000000000000000000000000000000..84110d9f31d6a22f5d2fa54c56b39e86fdcb93bf
--- /dev/null
+++ b/content/browser/download/download_item_factory.h
@@ -0,0 +1,63 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+//
+// The DownloadItemFactory is used to produce different DownloadItems.
+// It is separate from the DownloadManager to allow download manager
+// unit tests to control the items produced.
+
+#ifndef CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_
+#define CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_
+#pragma once
+
+#include "content/browser/download/download_item_impl.h"
+
+#include <string>
+
+struct DownloadCreateInfo;
+class DownloadRequestHandleInterface;
+class FilePath;
+class GURL;
+
+namespace content {
+class DownloadId;
+class DownloadItem;
+struct DownloadPersistentStoreInfo;
+}
+
+namespace net {
+class BoundNetLog;
+}
+
+namespace content {
+
+class DownloadItemFactory {
+public:
+ virtual ~DownloadItemFactory() {}
+
+ virtual content::DownloadItem* CreatePersistedItem(
+ DownloadItemImpl::Delegate* delegate,
+ content::DownloadId download_id,
+ const content::DownloadPersistentStoreInfo& info,
+ const net::BoundNetLog& bound_net_log) = 0;
+
+ virtual content::DownloadItem* CreateActiveItem(
+ DownloadItemImpl::Delegate* delegate,
+ const DownloadCreateInfo& info,
+ DownloadRequestHandleInterface* request_handle,
+ bool is_otr,
+ const net::BoundNetLog& bound_net_log) = 0;
+
+ virtual content::DownloadItem* CreateSavePageItem(
+ DownloadItemImpl::Delegate* delegate,
+ const FilePath& path,
+ const GURL& url,
+ bool is_otr,
+ content::DownloadId download_id,
+ const std::string& mime_type,
+ const net::BoundNetLog& bound_net_log) = 0;
+};
+
+} // namespace content
+
+#endif // CONTENT_BROWSER_DOWNLOAD_DOWNLOAD_ITEM_FACTORY_H_
« no previous file with comments | « content/browser/browser_context.cc ('k') | content/browser/download/download_item_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698