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

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

Issue 8817005: Revert 113007 - DownloadManager intereface refactoring to allow cleaner DownloadItem unit tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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
Index: content/browser/download/save_package.cc
===================================================================
--- content/browser/download/save_package.cc (revision 113083)
+++ content/browser/download/save_package.cc (working copy)
@@ -268,11 +268,17 @@
return false;
}
- // The download manager keeps ownership but adds us as an observer.
- download_ = download_manager_->CreateSavePackageDownloadItem(
- saved_main_file_path_, page_url_,
- browser_context->IsOffTheRecord(), this);
+ // Create the download item, and add ourself as an observer.
+ 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.
+ download_manager_->SavePageDownloadStarted(download_);
+
// Check save type and process the save page job.
if (save_type_ == SAVE_AS_COMPLETE_HTML) {
// Get directory
« no previous file with comments | « content/browser/download/mock_download_manager.cc ('k') | content/public/browser/download_manager_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698