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

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

Issue 14646036: Get rid of DownloadItemImpl::UpdateProgress() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added "Patch from" to commit message Created 7 years, 7 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/download_item_impl_unittest.cc ('k') | no next file » | 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 7553a54f77217dee71341bc691cd3e970192f155..9bbe1662da7ad3c9c0928154e1019953df336a94 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -365,7 +365,7 @@ void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) {
// with SavePackage flow.
if (download_->IsInProgress()) {
download_->SetTotalBytes(size);
- download_->UpdateProgress(size, 0, std::string());
+ 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.
@@ -792,7 +792,7 @@ void SavePackage::Finish() {
// with SavePackage flow.
if (download_->IsInProgress()) {
if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) {
- download_->UpdateProgress(
+ download_->DestinationUpdate(
all_save_items_count_, CurrentSpeed(), std::string());
download_->OnAllDataSaved(DownloadItem::kEmptyFileHash);
}
@@ -822,8 +822,10 @@ void SavePackage::SaveFinished(int32 save_id, int64 size, bool is_success) {
// Hack to avoid touching download_ after user cancel.
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
- if (download_ && download_->IsInProgress())
- download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string());
+ if (download_ && download_->IsInProgress()) {
+ download_->DestinationUpdate(
+ completed_count(), CurrentSpeed(), std::string());
+ }
if (save_item->save_source() == SaveFileCreateInfo::SAVE_FILE_FROM_DOM &&
save_item->url() == page_url_ && !save_item->received_bytes()) {
@@ -867,8 +869,10 @@ void SavePackage::SaveFailed(const GURL& save_url) {
// Hack to avoid touching download_ after user cancel.
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
- if (download_ && download_->IsInProgress())
- download_->UpdateProgress(completed_count(), CurrentSpeed(), std::string());
+ if (download_ && download_->IsInProgress()) {
+ download_->DestinationUpdate(
+ completed_count(), CurrentSpeed(), std::string());
+ }
if ((save_type_ == SAVE_PAGE_TYPE_AS_ONLY_HTML) ||
(save_type_ == SAVE_PAGE_TYPE_AS_MHTML) ||
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698