| Index: content/browser/download/save_package.cc
|
| diff --git a/content/browser/download/save_package.cc b/content/browser/download/save_package.cc
|
| index c6b8021e1b9b1b54c32460c4be35d0c93d170dc3..43bdc1e0fa637ce9d7763585c2c8cc3ea07cf417 100644
|
| --- a/content/browser/download/save_package.cc
|
| +++ b/content/browser/download/save_package.cc
|
| @@ -340,10 +340,11 @@ void SavePackage::OnMHTMLGenerated(const FilePath& path, int64 size) {
|
| // with SavePackage flow.
|
| if (download_->IsInProgress()) {
|
| download_->SetTotalBytes(size);
|
| + download_->UpdateProgress(size, 0, "");
|
| // Must call OnAllDataSaved here in order for
|
| // GDataDownloadObserver::ShouldUpload() to return true.
|
| // ShouldCompleteDownload() may depend on the gdata uploader to finish.
|
| - download_->OnAllDataSaved(size, DownloadItem::kEmptyFileHash);
|
| + download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
|
| }
|
|
|
| if (!download_manager_->GetDelegate() ||
|
| @@ -747,17 +748,19 @@ void SavePackage::Finish() {
|
| file_manager_,
|
| save_ids));
|
|
|
| - // Hack to avoid touching download_ after user cancel.
|
| - // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
|
| - // with SavePackage flow.
|
| - if (download_ && download_->IsInProgress()) {
|
| - if (save_type_ != content::SAVE_PAGE_TYPE_AS_MHTML) {
|
| - download_->OnAllDataSaved(all_save_items_count_,
|
| - DownloadItem::kEmptyFileHash);
|
| + if (download_) {
|
| + // Hack to avoid touching download_ after user cancel.
|
| + // TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
|
| + // with SavePackage flow.
|
| + if (download_->IsInProgress()) {
|
| + if (save_type_ != content::SAVE_PAGE_TYPE_AS_MHTML) {
|
| + download_->UpdateProgress(all_save_items_count_, CurrentSpeed(), "");
|
| + download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
|
| + }
|
| + download_->MarkAsComplete();
|
| }
|
| - download_->MarkAsComplete();
|
| + FinalizeDownloadEntry();
|
| }
|
| - FinalizeDownloadEntry();
|
| }
|
|
|
| // Called for updating end state.
|
|
|