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

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: 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/download/download_history.cc
diff --git a/chrome/browser/download/download_history.cc b/chrome/browser/download/download_history.cc
index 318883085e2a44ef1571ee8dd2aec64d4e41db3b..fcdf52ced27f5dbe41ed1b244f5f94bfe9241f98 100644
--- a/chrome/browser/download/download_history.cc
+++ b/chrome/browser/download/download_history.cc
@@ -107,13 +107,15 @@ 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->GetLastReason(),
((data != NULL) ? data->db_handle()
: history::DownloadDatabase::kUninitializedHandle),
item->GetOpened());
@@ -123,11 +125,13 @@ 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->interrupt_reason != current.interrupt_reason) ||
(previous->opened != current.opened));
}
@@ -218,14 +222,16 @@ 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->interrupt_reason,
it->opened);
DownloadHistoryData* data = DownloadHistoryData::Get(download_item);

Powered by Google App Engine
This is Rietveld 408576698