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

Side by Side Diff: content/browser/download/save_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 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/save_file.h" 5 #include "content/browser/download/save_file.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/public/browser/browser_thread.h" 8 #include "content/public/browser/browser_thread.h"
9 #include "net/base/file_stream.h" 9 #include "net/base/file_stream.h"
10 10
11 using content::BrowserThread; 11 using content::BrowserThread;
12 12
13 // TODO(asanka): SaveFile should use the target directory of the save package as 13 // TODO(asanka): SaveFile should use the target directory of the save package as
14 // the default download directory when initializing |file_|. 14 // the default download directory when initializing |file_|.
15 // Unfortunately, as it is, constructors of SaveFile don't always 15 // Unfortunately, as it is, constructors of SaveFile don't always
16 // have access to the SavePackage at this point. 16 // have access to the SavePackage at this point.
17 SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash) 17 SaveFile::SaveFile(const SaveFileCreateInfo* info, bool calculate_hash)
18 : file_(FilePath(), 18 : file_(FilePath(),
19 info->url, 19 info->url,
20 GURL(), 20 GURL(),
21 0, 21 0,
22 calculate_hash, 22 calculate_hash,
23 "", 23 "",
24 linked_ptr<net::FileStream>(), 24 scoped_ptr<net::FileStream>(),
25 net::BoundNetLog()), 25 net::BoundNetLog()),
26 info_(info) { 26 info_(info) {
27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 27 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
28 28
29 DCHECK(info); 29 DCHECK(info);
30 DCHECK(info->path.empty()); 30 DCHECK(info->path.empty());
31 } 31 }
32 32
33 SaveFile::~SaveFile() { 33 SaveFile::~SaveFile() {
34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 34 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 return file_.bytes_so_far(); 74 return file_.bytes_so_far();
75 } 75 }
76 76
77 bool SaveFile::GetHash(std::string* hash) { 77 bool SaveFile::GetHash(std::string* hash) {
78 return file_.GetHash(hash); 78 return file_.GetHash(hash);
79 } 79 }
80 80
81 std::string SaveFile::DebugString() const { 81 std::string SaveFile::DebugString() const {
82 return file_.DebugString(); 82 return file_.DebugString();
83 } 83 }
OLDNEW
« no previous file with comments | « content/browser/download/drag_download_file.cc ('k') | content/browser/renderer_host/buffered_resource_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698