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

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

Issue 11028131: Shift passage of FileStream in downloads system to be by scoped_ptr<>. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporated Al's comments. Created 8 years, 2 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.h ('k') | content/browser/download/save_file.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/drag_download_file.cc
diff --git a/content/browser/download/drag_download_file.cc b/content/browser/download/drag_download_file.cc
index e66b2016a2471ad7a00fb08f0292005135dbc074..ca9fb2b8737df0bc173baf2bb3ca622820e4d8d0 100644
--- a/content/browser/download/drag_download_file.cc
+++ b/content/browser/download/drag_download_file.cc
@@ -25,12 +25,12 @@ using content::WebContents;
DragDownloadFile::DragDownloadFile(
const FilePath& file_name_or_path,
- linked_ptr<net::FileStream> file_stream,
+ scoped_ptr<net::FileStream> file_stream,
const GURL& url,
const content::Referrer& referrer,
const std::string& referrer_encoding,
WebContents* web_contents)
- : file_stream_(file_stream),
+ : file_stream_(file_stream.Pass()),
url_(url),
referrer_(referrer),
referrer_encoding_(referrer_encoding),
@@ -133,14 +133,15 @@ void DragDownloadFile::InitiateDownload() {
download_manager_observer_added_ = true;
download_manager_->AddObserver(this);
- content::DownloadSaveInfo save_info;
- save_info.file_path = file_path_;
- save_info.file_stream = file_stream_;
+ scoped_ptr<content::DownloadSaveInfo> save_info;
+ save_info->file_path = file_path_;
+ save_info->file_stream = file_stream_.Pass(); // Nulls file_stream_
download_stats::RecordDownloadSource(
download_stats::INITIATED_BY_DRAG_N_DROP);
scoped_ptr<DownloadUrlParameters> params(
- DownloadUrlParameters::FromWebContents(web_contents_, url_, save_info));
+ DownloadUrlParameters::FromWebContents(
+ web_contents_, url_, save_info.Pass()));
params->set_referrer(referrer_);
params->set_referrer_encoding(referrer_encoding_);
download_manager_->DownloadUrl(params.Pass());
« no previous file with comments | « content/browser/download/drag_download_file.h ('k') | content/browser/download/save_file.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698