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

Unified Diff: content/browser/download/save_package.cc

Issue 1751603002: [Downloads] Rework how hashes are calculated for download files. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase on top of https://codereview.chromium.org/1781983002 since that's going in first. 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
« no previous file with comments | « content/browser/download/save_file.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/save_package.cc
diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
index 8a666e29fe4ecaf90654a17b2f0b93c2d7bc1d57..5686fcfe8f48be2956f52fbb36a777f1445e182e 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -373,12 +373,10 @@ void SavePackage::OnMHTMLGenerated(int64_t size) {
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
if (download_->GetState() == DownloadItem::IN_PROGRESS) {
- download_->SetTotalBytes(size);
- download_->DestinationUpdate(size, 0, std::string());
// Must call OnAllDataSaved here in order for
// GDataDownloadObserver::ShouldUpload() to return true.
// ShouldCompleteDownload() may depend on the gdata uploader to finish.
- download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
+ download_->OnAllDataSaved(size, scoped_ptr<crypto::SecureHash>());
}
if (!download_manager_->GetDelegate()) {
@@ -783,9 +781,9 @@ void SavePackage::Finish() {
// with SavePackage flow.
if (download_->GetState() == DownloadItem::IN_PROGRESS) {
if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) {
- download_->DestinationUpdate(
- all_save_items_count_, CurrentSpeed(), std::string());
- download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
+ download_->DestinationUpdate(all_save_items_count_, CurrentSpeed());
+ download_->OnAllDataSaved(all_save_items_count_,
+ scoped_ptr<crypto::SecureHash>());
}
download_->MarkAsComplete();
}
@@ -816,8 +814,7 @@ void SavePackage::SaveFinished(SaveItemId save_item_id,
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
if (download_ && (download_->GetState() == DownloadItem::IN_PROGRESS)) {
- download_->DestinationUpdate(
- completed_count(), CurrentSpeed(), std::string());
+ download_->DestinationUpdate(completed_count(), CurrentSpeed());
}
if (save_item->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_DOM &&
« no previous file with comments | « content/browser/download/save_file.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698