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

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

Issue 11363222: Persist download interrupt reason, both target and current paths, and url_chain. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged to r180302 Created 7 years, 11 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/history/download_database.cc ('k') | chrome/browser/history/download_row.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/history/download_row.h
diff --git a/chrome/browser/history/download_row.h b/chrome/browser/history/download_row.h
index 1e36c7652c2c4604470316700d1e95ba93814dff..36f5575bc247670b94f47f7d5129c78b9d4ebb7b 100644
--- a/chrome/browser/history/download_row.h
+++ b/chrome/browser/history/download_row.h
@@ -5,8 +5,12 @@
#ifndef CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_
#define CHROME_BROWSER_HISTORY_DOWNLOAD_ROW_H_
+#include <vector>
+
#include "base/file_path.h"
#include "base/time.h"
+#include "content/public/browser/download_danger_type.h"
+#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/download_item.h"
#include "googleurl/src/gurl.h"
@@ -18,26 +22,33 @@ namespace history {
struct DownloadRow {
DownloadRow();
DownloadRow(
- const FilePath& path,
- const GURL& url,
+ const FilePath& current_path,
+ const FilePath& target_path,
+ const std::vector<GURL>& url_chain,
const GURL& referrer,
const base::Time& start,
const base::Time& end,
int64 received,
int64 total,
content::DownloadItem::DownloadState download_state,
+ content::DownloadDangerType danger_type,
+ content::DownloadInterruptReason interrupt_reason,
int64 handle,
bool download_opened);
~DownloadRow();
- // The current path to the downloaded file.
- // TODO(benjhayden/asanka): Persist the target filename as well.
- FilePath path;
+ // The current path to the download (potentially different from final if
+ // download is in progress or interrupted).
+ FilePath current_path;
+
+ // The target path where the download will go when it's complete.
+ FilePath target_path;
- // The URL from which we are downloading. This is the final URL after any
- // redirection by the server for |url_chain|. Is not changed by
+ // The URL redirect chain through which we are downloading. The front
+ // is the url that the initial request went to, and the back is the
+ // url from which we ended up getting data. This is not changed by
// UpdateDownload().
- GURL url;
+ std::vector<GURL> url_chain;
// The URL that referred us. Is not changed by UpdateDownload().
GURL referrer_url;
@@ -58,6 +69,13 @@ struct DownloadRow {
// The current state of the download.
content::DownloadItem::DownloadState state;
+ // Whether and how the download is dangerous.
+ content::DownloadDangerType danger_type;
+
+ // The reason the download was interrupted, if
+ // state == DownloadItem::INTERRUPTED
+ content::DownloadInterruptReason interrupt_reason;
+
// The handle of the download in the database. Is not changed by
// UpdateDownload().
int64 db_handle;
« no previous file with comments | « chrome/browser/history/download_database.cc ('k') | chrome/browser/history/download_row.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698