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

Unified Diff: components/history/core/browser/download_row.h

Issue 1781983002: [Downloads] Introduce GUIDs for downloads. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 9 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
Index: components/history/core/browser/download_row.h
diff --git a/components/history/core/browser/download_row.h b/components/history/core/browser/download_row.h
index 98304519ce6f26488b2a98dc97fa3df90006582a..3127c3f3d6cd1578542bcab0ee6a9e319d106a86 100644
--- a/components/history/core/browser/download_row.h
+++ b/components/history/core/browser/download_row.h
@@ -26,6 +26,7 @@ struct DownloadRow {
const base::FilePath& target_path,
const std::vector<GURL>& url_chain,
const GURL& referrer,
+ const std::string& http_method,
const std::string& mime_type,
const std::string& original_mime_type,
const base::Time& start,
@@ -37,13 +38,17 @@ struct DownloadRow {
DownloadState download_state,
DownloadDangerType danger_type,
DownloadInterruptReason interrupt_reason,
+ const std::string& hash,
DownloadId id,
+ const std::string& guid,
bool download_opened,
const std::string& ext_id,
const std::string& ext_name);
DownloadRow(const DownloadRow& other);
~DownloadRow();
+ bool operator==(const DownloadRow&) const;
+
// The current path to the download (potentially different from final if
// download is in progress or interrupted).
base::FilePath current_path;
@@ -60,6 +65,10 @@ struct DownloadRow {
// The URL that referred us. Is not changed by UpdateDownload().
GURL referrer_url;
+ // HTTP method used for the request. GET is assumed if the method was not
+ // stored for a download in the history database.
+ std::string http_method;
+
// The MIME type of the download, might be based on heuristics.
std::string mime_type;
@@ -94,9 +103,18 @@ struct DownloadRow {
// The reason the download was interrupted, if state == kStateInterrupted.
DownloadInterruptReason interrupt_reason;
+ // The raw SHA-256 hash of the complete or partial download contents. Not hex
+ // encoded.
+ std::string hash;
+
// The id of the download in the database. Is not changed by UpdateDownload().
+ // Note: This field should be considered deprecated in favor of |guid| below.
+ // See http://crbug.com/593020.
DownloadId id;
+ // The GUID of the download in the database. Not changed by UpdateDownload().
+ std::string guid;
+
// Whether this download has ever been opened from the browser.
bool opened;
« no previous file with comments | « components/history/core/browser/download_database.cc ('k') | components/history/core/browser/download_row.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698