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..5d5cd5f160864c6a4f0bb3285b21074bc295fb25 100644 |
--- a/chrome/browser/download/download_history.cc |
+++ b/chrome/browser/download/download_history.cc |
@@ -127,31 +127,24 @@ history::DownloadRow GetDownloadRow( |
#endif |
return history::DownloadRow( |
- item->GetFullPath(), |
- item->GetTargetFilePath(), |
- item->GetUrlChain(), |
+ item->GetFullPath(), item->GetTargetFilePath(), item->GetUrlChain(), |
item->GetReferrerUrl(), |
- item->GetMimeType(), |
- item->GetOriginalMimeType(), |
- item->GetStartTime(), |
- item->GetEndTime(), |
- item->GetETag(), |
- item->GetLastModifiedTime(), |
- item->GetReceivedBytes(), |
- item->GetTotalBytes(), |
+ std::string(), // HTTP method (not available yet) |
+ item->GetMimeType(), item->GetOriginalMimeType(), item->GetStartTime(), |
+ item->GetEndTime(), item->GetETag(), item->GetLastModifiedTime(), |
+ item->GetReceivedBytes(), item->GetTotalBytes(), |
history::ToHistoryDownloadState(item->GetState()), |
history::ToHistoryDownloadDangerType(item->GetDangerType()), |
history::ToHistoryDownloadInterruptReason(item->GetLastReason()), |
- history::ToHistoryDownloadId(item->GetId()), |
- item->GetOpened(), |
- by_ext_id, |
- by_ext_name); |
+ std::string(), // Hash value (not available yet) |
+ history::ToHistoryDownloadId(item->GetId()), item->GetGuid(), |
+ item->GetOpened(), by_ext_id, by_ext_name); |
} |
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 +156,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,20 +258,10 @@ void DownloadHistory::QueryCallback(scoped_ptr<InfoVector> infos) { |
it != infos->end(); ++it) { |
loading_id_ = history::ToContentDownloadId(it->id); |
content::DownloadItem* item = notifier_.GetManager()->CreateDownloadItem( |
- loading_id_, |
- it->current_path, |
- it->target_path, |
- it->url_chain, |
- it->referrer_url, |
- it->mime_type, |
- it->original_mime_type, |
- it->start_time, |
- it->end_time, |
- it->etag, |
- it->last_modified, |
- it->received_bytes, |
- it->total_bytes, |
- history::ToContentDownloadState(it->state), |
+ it->guid, loading_id_, it->current_path, it->target_path, it->url_chain, |
+ it->referrer_url, it->mime_type, it->original_mime_type, it->start_time, |
+ it->end_time, it->etag, it->last_modified, it->received_bytes, |
+ it->total_bytes, history::ToContentDownloadState(it->state), |
history::ToContentDownloadDangerType(it->danger_type), |
history::ToContentDownloadInterruptReason(it->interrupt_reason), |
it->opened); |