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

Unified Diff: chrome/browser/history/download_create_info.h

Issue 6969009: Reduced the lifetime of DownloadCreateInfo. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed structure accessors from DownloadItem, per request. Created 9 years, 7 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 | « chrome/browser/download/download_util.cc ('k') | chrome/browser/history/download_create_info.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/download_create_info.h
diff --git a/chrome/browser/history/download_create_info.h b/chrome/browser/history/download_create_info.h
index 77e966b5795899bf4edb95a190962bcf55caf77d..8800dece6e12d85167be72085fa3a6ebd5d0ba44 100644
--- a/chrome/browser/history/download_create_info.h
+++ b/chrome/browser/history/download_create_info.h
@@ -18,6 +18,60 @@
#include "chrome/browser/download/download_process_handle.h"
#include "googleurl/src/gurl.h"
+class DownloadItem;
+
+// Contains the information that is stored in the History database (or refers
+// to it).
+struct DownloadHistoryInfo {
Paweł Hajdan Jr. 2011/05/18 20:20:33 Could you extract this to its own header file? The
ahendrickson 2011/05/19 13:51:38 Done.
+ DownloadHistoryInfo();
+ explicit DownloadHistoryInfo(const DownloadItem& item);
+ DownloadHistoryInfo(const std::vector<GURL>& url,
+ const GURL& referrer,
+ int64 total_bytes);
+ DownloadHistoryInfo(const FilePath& path,
+ const GURL& url,
+ const base::Time& start,
+ int64 received,
+ int64 total,
+ int32 download_state);
+ DownloadHistoryInfo(const FilePath& path,
+ const std::vector<GURL>& url,
+ const GURL& referrer,
+ const base::Time& start,
+ int64 received,
+ int64 total,
+ int32 download_state,
+ int64 handle,
+ int32 id);
+
+ // The URL from which we are downloading. This is the final URL after any
+ // redirection by the server for |url_chain|.
+ const GURL& url() const;
+
+ // Download ID assigned by DownloadResourceHandler.
+ // Used by the history back end, to return in a callback.
+ int32 download_id;
+
+ // The final path where the download is saved.
+ FilePath path;
+
+ // The chain of redirects that leading up to and including the final URL.
+ std::vector<GURL> url_chain;
+
+ // The URL that referred us.
+ GURL referrer_url;
+
+ base::Time start_time;
+
+ int64 received_bytes;
+
+ int64 total_bytes;
+
+ int32 state;
+
+ int64 db_handle;
+};
+
// Used for informing the download database of a new download, where we don't
// want to pass DownloadItems between threads. The history service also uses a
// vector of these structs for passing us the state of all downloads at
@@ -58,6 +112,8 @@ struct DownloadCreateInfo {
int32 state;
int32 download_id;
bool has_user_gesture;
+ // The handle to the process information. Used for operations outside the
+ // download system.
DownloadProcessHandle process_handle;
int64 db_handle;
std::string content_disposition;
« no previous file with comments | « chrome/browser/download/download_util.cc ('k') | chrome/browser/history/download_create_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698