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

Unified Diff: chrome/browser/extensions/api/downloads/downloads_api.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 | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/api/downloads/downloads_api.cc
diff --git a/chrome/browser/extensions/api/downloads/downloads_api.cc b/chrome/browser/extensions/api/downloads/downloads_api.cc
index eb18822cf04f497497626e513326a484444c5062..5645a53ed2e52c660b808b4891065e93c4238d61 100644
--- a/chrome/browser/extensions/api/downloads/downloads_api.cc
+++ b/chrome/browser/extensions/api/downloads/downloads_api.cc
@@ -578,7 +578,8 @@ bool DownloadsDownloadFunction::RunImpl() {
return false;
}
- content::DownloadSaveInfo save_info;
+ scoped_ptr<content::DownloadSaveInfo> save_info(
+ new content::DownloadSaveInfo());
if (options.filename.get()) {
// TODO(benjhayden): Make json_schema_compiler generate string16s instead of
// std::strings. Can't get filename16 from options.ToValue() because that
@@ -594,11 +595,11 @@ bool DownloadsDownloadFunction::RunImpl() {
}
// TODO(benjhayden) Ensure that this filename is interpreted as a path
// relative to the default downloads directory without allowing '..'.
- save_info.suggested_name = filename16;
+ save_info->suggested_name = filename16;
}
if (options.save_as.get())
- save_info.prompt_for_save_location = *options.save_as.get();
+ save_info->prompt_for_save_location = *options.save_as.get();
Profile* current_profile = profile();
if (include_incognito() && profile()->HasOffTheRecordProfile())
@@ -610,7 +611,7 @@ bool DownloadsDownloadFunction::RunImpl() {
render_view_host()->GetProcess()->GetID(),
render_view_host()->GetRoutingID(),
current_profile->GetResourceContext(),
- save_info));
+ save_info.Pass()));
if (options.headers.get()) {
typedef extensions::api::downloads::HeaderNameValuePair HeaderNameValuePair;
« no previous file with comments | « chrome/browser/download/download_browsertest.cc ('k') | chrome/browser/extensions/webstore_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698