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

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

Issue 8503018: Split DownloadItem into an ABC, an Impl, and a Mock. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: merge Created 9 years, 1 month 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/mock_download_manager_delegate.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 6be55135cf025d266ac789de572aad75918b3250..cf22feb74860cae1bd1b67e8510f525e33833240 100644
--- a/content/browser/download/save_package.cc
+++ b/content/browser/download/save_package.cc
@@ -20,7 +20,7 @@
#include "base/utf_string_conversions.h"
#include "content/browser/browser_context.h"
#include "content/browser/download/download_file_manager.h"
-#include "content/browser/download/download_item.h"
+#include "content/browser/download/download_item_impl.h"
#include "content/browser/download/download_manager.h"
#include "content/browser/download/save_file.h"
#include "content/browser/download/save_file_manager.h"
@@ -266,11 +266,11 @@ bool SavePackage::Init() {
}
// Create the download item, and add ourself as an observer.
- download_ = new DownloadItem(download_manager_,
- saved_main_file_path_,
- page_url_,
- browser_context->IsOffTheRecord(),
- download_manager_->GetNextId());
+ download_ = new DownloadItemImpl(download_manager_,
+ saved_main_file_path_,
+ page_url_,
+ browser_context->IsOffTheRecord(),
+ download_manager_->GetNextId());
download_->AddObserver(this);
// Transfer ownership to the download manager.
@@ -293,7 +293,7 @@ bool SavePackage::Init() {
// Add this item to waiting list.
waiting_item_queue_.push(save_item);
all_save_items_count_ = 1;
- download_->set_total_bytes(1);
+ download_->SetTotalBytes(1);
DoSavingProcess();
}
@@ -1014,7 +1014,7 @@ void SavePackage::OnReceivedSavableResourceLinksForCurrentPage(
// We use total bytes as the total number of files we want to save.
if (download_)
- download_->set_total_bytes(all_save_items_count_);
+ download_->SetTotalBytes(all_save_items_count_);
if (all_save_items_count_) {
// Put all sub-resources to wait list.
@@ -1277,7 +1277,7 @@ void SavePackage::OnDownloadUpdated(DownloadItem* download) {
DCHECK(download_manager_);
// Check for removal.
- if (download->state() == DownloadItem::REMOVING)
+ if (download->GetState() == DownloadItem::REMOVING)
StopObservation();
}
« no previous file with comments | « content/browser/download/mock_download_manager_delegate.cc ('k') | content/content_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698