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

Unified Diff: chrome/browser/download/download_history.cc

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: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index b901ce4e40c5c691dbeba374bef1e397ba1891ee..115a52c93c48a18b75a0a4d4ff2922f57d86a128 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -131,6 +131,7 @@ history::DownloadRow GetDownloadRow(
item->GetTargetFilePath(),
item->GetUrlChain(),
item->GetReferrerUrl(),
+ std::string(), // HTTP method (not available yet)
item->GetMimeType(),
item->GetOriginalMimeType(),
item->GetStartTime(),
@@ -142,7 +143,9 @@ history::DownloadRow GetDownloadRow(
history::ToHistoryDownloadState(item->GetState()),
history::ToHistoryDownloadDangerType(item->GetDangerType()),
history::ToHistoryDownloadInterruptReason(item->GetLastReason()),
+ std::string(), // Hash value (not available yet)
history::ToHistoryDownloadId(item->GetId()),
+ item->GetGuid(),
item->GetOpened(),
by_ext_id,
by_ext_name);
@@ -150,8 +153,8 @@ history::DownloadRow GetDownloadRow(
bool ShouldUpdateHistory(const history::DownloadRow* previous,
const history::DownloadRow& current) {
- // Ignore url, referrer, mime_type, original_mime_type, start_time,
- // id, db_handle, which don't change.
+ // Ignore url_chain, referrer, http_method, mime_type, original_mime_type,
+ // start_time, id, guid, which don't change.
return ((previous == NULL) ||
(previous->current_path != current.current_path) ||
(previous->target_path != current.target_path) ||
@@ -163,6 +166,7 @@ bool ShouldUpdateHistory(const history::DownloadRow* previous,
(previous->state != current.state) ||
(previous->danger_type != current.danger_type) ||
(previous->interrupt_reason != current.interrupt_reason) ||
+ (previous->hash != current.hash) ||
(previous->opened != current.opened) ||
(previous->by_ext_id != current.by_ext_id) ||
(previous->by_ext_name != current.by_ext_name));
@@ -264,6 +268,7 @@ void DownloadHistory::QueryCallback(scoped_ptr<InfoVector> infos) {
it != infos->end(); ++it) {
loading_id_ = history::ToContentDownloadId(it->id);
content::DownloadItem* item = notifier_.GetManager()->CreateDownloadItem(
+ it->guid,
loading_id_,
it->current_path,
it->target_path,

Powered by Google App Engine
This is Rietveld 408576698