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

Unified Diff: content/browser/download/download_resource_handler.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/download_resource_handler.h ('k') | content/browser/download/drag_download_file.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 1de77f79d67791618d389d627e7eaf9f2cf8a916..68c9c3a4e37a5ca0ba08f4e6f8827e287c85dc0f 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -82,12 +82,12 @@ static void StartOnUIThread(
DownloadResourceHandler::DownloadResourceHandler(
net::URLRequest* request,
const DownloadResourceHandler::OnStartedCallback& started_cb,
- const content::DownloadSaveInfo& save_info)
+ scoped_ptr<content::DownloadSaveInfo> save_info)
: render_view_id_(0), // Actually initialized below.
content_length_(0),
request_(request),
started_cb_(started_cb),
- save_info_(save_info),
+ save_info_(save_info.Pass()),
last_buffer_size_(0),
bytes_read_(0),
pause_count_(0),
@@ -159,7 +159,7 @@ bool DownloadResourceHandler::OnResponseStarted(
info->url_chain = request_->url_chain();
info->referrer_url = GURL(request_->referrer());
info->start_time = base::Time::Now();
- info->received_bytes = save_info_.offset;
+ info->received_bytes = save_info_->offset;
info->total_bytes = content_length_;
info->state = DownloadItem::IN_PROGRESS;
info->has_user_gesture = request_info->HasUserGesture();
@@ -196,9 +196,9 @@ bool DownloadResourceHandler::OnResponseStarted(
}
info->prompt_user_for_save_location =
- save_info_.prompt_for_save_location && save_info_.file_path.empty();
+ save_info_->prompt_for_save_location && save_info_->file_path.empty();
info->referrer_charset = request_->context()->referrer_charset();
- info->save_info = save_info_;
+ info->save_info = save_info_.Pass();
BrowserThread::PostTask(
BrowserThread::UI, FROM_HERE,
@@ -429,15 +429,13 @@ std::string DownloadResourceHandler::DebugString() const {
" request_id = " "%d"
" }"
" render_view_id_ = " "%d"
- " save_info_.file_path = \"%" PRFilePath "\""
" }",
request_ ?
request_->url().spec().c_str() :
"<NULL request>",
global_id_.child_id,
global_id_.request_id,
- render_view_id_,
- save_info_.file_path.value().c_str());
+ render_view_id_);
}
DownloadResourceHandler::~DownloadResourceHandler() {
« no previous file with comments | « content/browser/download/download_resource_handler.h ('k') | content/browser/download/drag_download_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698