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

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

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
Index: chrome/browser/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 131a42b1e1810fbe139d03b46fdf6a3e23bf1fdb..b38ddbf68e321d6ed1cb898db9ef722f7b49c22e 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -107,13 +107,16 @@ history::DownloadRow GetDownloadRow(
DownloadHistoryData* data = DownloadHistoryData::Get(item);
return history::DownloadRow(
item->GetFullPath(),
- item->GetURL(),
+ item->GetTargetFilePath(),
+ item->GetUrlChain(),
item->GetReferrerUrl(),
item->GetStartTime(),
item->GetEndTime(),
item->GetReceivedBytes(),
item->GetTotalBytes(),
item->GetState(),
+ item->GetDangerType(),
+ item->GetLastReason(),
((data != NULL) ? data->db_handle()
: history::DownloadDatabase::kUninitializedHandle),
item->GetOpened());
@@ -123,11 +126,14 @@ bool ShouldUpdateHistory(const history::DownloadRow* previous,
const history::DownloadRow& current) {
// Ignore url, referrer, start_time, db_handle, which don't change.
return ((previous == NULL) ||
- (previous->path != current.path) ||
+ (previous->current_path != current.current_path) ||
+ (previous->target_path != current.target_path) ||
(previous->end_time != current.end_time) ||
(previous->received_bytes != current.received_bytes) ||
(previous->total_bytes != current.total_bytes) ||
(previous->state != current.state) ||
+ (previous->danger_type != current.danger_type) ||
+ (previous->interrupt_reason != current.interrupt_reason) ||
(previous->opened != current.opened));
}
@@ -218,14 +224,17 @@ void DownloadHistory::QueryCallback(scoped_ptr<InfoVector> infos) {
loading_db_handle_ = it->db_handle;
content::DownloadItem* download_item =
notifier_.GetManager()->CreateDownloadItem(
- it->path,
- it->url,
+ it->current_path,
+ it->target_path,
+ it->url_chain,
it->referrer_url,
it->start_time,
it->end_time,
it->received_bytes,
it->total_bytes,
it->state,
+ it->danger_type,
+ it->interrupt_reason,
it->opened);
DownloadHistoryData* data = DownloadHistoryData::Get(download_item);
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/download/download_history_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698