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

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

Issue 16994004: Remove DownloadItem::Is*() in favor of DI::GetState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@di-getstate-2
Patch Set: Rebased to fix new test, applied suggestions from bauerb and benjhayden Created 7 years, 6 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/drag_download_file.cc ('k') | content/public/browser/download_item.h » ('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 17514c3c92f065318e5dfa90c4540621bb10623d..594e394e36bbb8e73f464b54a96f76f6d00abd6d 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -363,7 +363,7 @@ void SavePackage::OnMHTMLGenerated(const base::FilePath& path, int64 size) {
// Hack to avoid touching download_ after user cancel.
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
- if (download_->IsInProgress()) {
+ if (download_->GetState() == DownloadItem::IN_PROGRESS) {
download_->SetTotalBytes(size);
download_->DestinationUpdate(size, 0, std::string());
// Must call OnAllDataSaved here in order for
@@ -790,7 +790,7 @@ void SavePackage::Finish() {
// Hack to avoid touching download_ after user cancel.
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
- if (download_->IsInProgress()) {
+ if (download_->GetState() == DownloadItem::IN_PROGRESS) {
if (save_type_ != SAVE_PAGE_TYPE_AS_MHTML) {
download_->DestinationUpdate(
all_save_items_count_, CurrentSpeed(), std::string());
@@ -822,7 +822,7 @@ 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()) {
+ if (download_ && (download_->GetState() == DownloadItem::IN_PROGRESS)) {
download_->DestinationUpdate(
completed_count(), CurrentSpeed(), std::string());
}
@@ -869,7 +869,7 @@ 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()) {
+ if (download_ && (download_->GetState() == DownloadItem::IN_PROGRESS)) {
download_->DestinationUpdate(
completed_count(), CurrentSpeed(), std::string());
}
@@ -1164,7 +1164,7 @@ void SavePackage::OnReceivedSavableResourceLinksForCurrentPage(
// Hack to avoid touching download_ after user cancel.
// TODO(rdsmith/benjhayden): Integrate canceling on DownloadItem
// with SavePackage flow.
- if (download_ && download_->IsInProgress())
+ if (download_ && (download_->GetState() == DownloadItem::IN_PROGRESS))
download_->SetTotalBytes(all_save_items_count_);
if (all_save_items_count_) {
« no previous file with comments | « content/browser/download/drag_download_file.cc ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698