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

Side by Side Diff: content/browser/download/download_file_factory.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: Removed blank line. 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/download/download_file_factory.h" 5 #include "content/browser/download/download_file_factory.h"
6 6
7 #include "content/browser/download/download_file_impl.h" 7 #include "content/browser/download/download_file_impl.h"
8 #include "content/browser/power_save_blocker.h" 8 #include "content/browser/power_save_blocker.h"
9 9
10 namespace content { 10 namespace content {
11 11
12 DownloadFileFactory::~DownloadFileFactory() {} 12 DownloadFileFactory::~DownloadFileFactory() {}
13 13
14 DownloadFile* DownloadFileFactory::CreateFile( 14 DownloadFile* DownloadFileFactory::CreateFile(
15 DownloadCreateInfo* info, 15 scoped_ptr<DownloadCreateInfo> info,
16 scoped_ptr<content::ByteStreamReader> stream, 16 scoped_ptr<content::ByteStreamReader> stream,
17 DownloadManager* download_manager, 17 DownloadManager* download_manager,
18 bool calculate_hash, 18 bool calculate_hash,
19 const net::BoundNetLog& bound_net_log) { 19 const net::BoundNetLog& bound_net_log) {
20 // Ownership will be taken by DownloadFileImpl.
benjhayden 2012/10/11 19:41:12 So why not make DFI take a scoped_ptr?
Randy Smith (Not in Mondays) 2012/10/15 18:56:32 You know, as I went through this CL, I *knew* you
21 DownloadRequestHandle* request_handle(
22 new DownloadRequestHandle(info->request_handle));
23
20 return new DownloadFileImpl( 24 return new DownloadFileImpl(
21 info, stream.Pass(), new DownloadRequestHandle(info->request_handle), 25 info.Pass(), stream.Pass(), request_handle, download_manager,
22 download_manager, calculate_hash, 26 calculate_hash,
23 scoped_ptr<content::PowerSaveBlocker>( 27 scoped_ptr<content::PowerSaveBlocker>(
24 new content::PowerSaveBlocker( 28 new content::PowerSaveBlocker(
25 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension, 29 content::PowerSaveBlocker::kPowerSaveBlockPreventAppSuspension,
26 "Download in progress")).Pass(), 30 "Download in progress")).Pass(),
27 bound_net_log); 31 bound_net_log);
28 } 32 }
29 33
30 } // namespace content 34 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698