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

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

Issue 8399001: Use a DownloadRequestHandle pointer in construction to allow mocking for tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to TOT. Created 9 years, 2 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/download/download_file_unittest.cc ('k') | content/browser/download/download_item.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item.h
diff --git a/content/browser/download/download_item.h b/content/browser/download/download_item.h
index 9b7cb804ffe17e47f24aab615ab31823c438ab18..aaa60d6a6a3406b69415dde206675ade4e877208 100644
--- a/content/browser/download/download_item.h
+++ b/content/browser/download/download_item.h
@@ -22,6 +22,7 @@
#include "base/basictypes.h"
#include "base/file_path.h"
+#include "base/memory/scoped_ptr.h"
#include "base/observer_list.h"
#include "base/time.h"
#include "base/timer.h"
@@ -36,6 +37,8 @@
class DownloadFileManager;
class DownloadId;
class DownloadManager;
+class TabContents;
+
struct DownloadCreateInfo;
struct DownloadPersistentStoreInfo;
@@ -117,10 +120,11 @@ class CONTENT_EXPORT DownloadItem {
DownloadItem(DownloadManager* download_manager,
const DownloadPersistentStoreInfo& info);
- // Constructing for a regular download:
+ // Constructing for a regular download.
+ // Takes ownership of the object pointed to by |request_handle|.
DownloadItem(DownloadManager* download_manager,
const DownloadCreateInfo& info,
- const DownloadRequestHandle& request_handle,
+ DownloadRequestHandleInterface* request_handle,
bool is_otr);
// Constructing for the "Save Page As..." feature:
@@ -311,9 +315,8 @@ class CONTENT_EXPORT DownloadItem {
DownloadPersistentStoreInfo GetPersistentStoreInfo() const;
DownloadStateInfo state_info() const { return state_info_; }
- const DownloadRequestHandle& request_handle() const {
- return request_handle_;
- }
+
+ TabContents* GetTabContents() const;
// Returns the final target file path for the download.
FilePath GetTargetFilePath() const;
@@ -377,7 +380,7 @@ class CONTENT_EXPORT DownloadItem {
// The handle to the request information. Used for operations outside the
// download system.
- DownloadRequestHandle request_handle_;
+ scoped_ptr<DownloadRequestHandleInterface> request_handle_;
// Download ID assigned by DownloadResourceHandler.
DownloadId download_id_;
« no previous file with comments | « content/browser/download/download_file_unittest.cc ('k') | content/browser/download/download_item.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698