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

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: Incorporated Ben's comments. Created 8 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: chrome/browser/history/download_row.h
diff --git a/chrome/browser/history/download_row.h b/chrome/browser/history/download_row.h
index 1e36c7652c2c4604470316700d1e95ba93814dff..0b1bba718a464325418962ba2a5086350f4ceaac 100644
--- a/chrome/browser/history/download_row.h
+++ b/chrome/browser/history/download_row.h
@@ -7,6 +7,7 @@
#include "base/file_path.h"
#include "base/time.h"
+#include "content/public/browser/download_interrupt_reasons.h"
#include "content/public/browser/download_item.h"
#include "googleurl/src/gurl.h"
@@ -18,26 +19,32 @@ 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::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 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 target path where the download will go when it's complete.
+ FilePath target_path;
+
+ // 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 +65,10 @@ struct DownloadRow {
// The current state of the download.
content::DownloadItem::DownloadState state;
+ // 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;

Powered by Google App Engine
This is Rietveld 408576698