summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_extension_api.cc
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:56:05 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-19 20:56:05 +0000
commitc1ba9984633ed7ce0b57f939825043d196d0a1d2 (patch)
tree6544ecfd6723fb96d66435e346d2edc82bcee1b7 /chrome/browser/download/download_extension_api.cc
parenta36773dd8f0f23e110f2ed081d8fdca327cb562c (diff)
downloadchromium_src-c1ba9984633ed7ce0b57f939825043d196d0a1d2.zip
chromium_src-c1ba9984633ed7ce0b57f939825043d196d0a1d2.tar.gz
chromium_src-c1ba9984633ed7ce0b57f939825043d196d0a1d2.tar.bz2
Cleanup: ResourceDispatcherHost::BeginDownload takes a scoped_ptr<URLRequest> argument.
This used to take an URLRequest*, with a comment about ownership. Changing to a scoped_ptr argument makes the ownership explicit and enforceable by the compiler. Also, changed the name of the child_id argument to be process_unique_id to be consistent with the rest of the file. Review URL: http://codereview.chromium.org/9150028 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118351 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_extension_api.cc')
-rw-r--r--chrome/browser/download/download_extension_api.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/chrome/browser/download/download_extension_api.cc b/chrome/browser/download/download_extension_api.cc
index 34055e0..24ccfd4 100644
--- a/chrome/browser/download/download_extension_api.cc
+++ b/chrome/browser/download/download_extension_api.cc
@@ -276,7 +276,8 @@ void DownloadsDownloadFunction::BeginDownloadOnIOThread() {
// TODO(benjhayden) Ensure that this filename is interpreted as a path
// relative to the default downloads directory without allowing '..'.
save_info.suggested_name = iodata_->filename;
- net::URLRequest* request = new net::URLRequest(iodata_->url, iodata_->rdh);
+ scoped_ptr<net::URLRequest> request(
+ new net::URLRequest(iodata_->url, iodata_->rdh));
request->set_method(iodata_->method);
if (iodata_->extra_headers != NULL) {
for (size_t index = 0; index < iodata_->extra_headers->GetSize(); ++index) {
@@ -293,7 +294,7 @@ void DownloadsDownloadFunction::BeginDownloadOnIOThread() {
iodata_->post_body.size());
}
iodata_->rdh->BeginDownload(
- request,
+ request.Pass(),
save_info,
iodata_->save_as,
base::Bind(&DownloadsDownloadFunction::OnStarted, this),