Chromium Code Reviews| Index: chrome/browser/download/base_file.cc |
| diff --git a/chrome/browser/download/base_file.cc b/chrome/browser/download/base_file.cc |
| index 7ea96b5d758c662fd3515ec0daa96a84b3c3a661..8c442865c60edadb3a5b293982df5f899c511efc 100644 |
| --- a/chrome/browser/download/base_file.cc |
| +++ b/chrome/browser/download/base_file.cc |
| @@ -46,7 +46,7 @@ BaseFile::~BaseFile() { |
| Cancel(); // Will delete the file. |
| } |
| -bool BaseFile::Initialize(bool calculate_hash) { |
| +bool BaseFile::Initialize(bool calculate_hash, const FilePath& save_path) { |
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| DCHECK(!detached_); |
| @@ -55,10 +55,11 @@ bool BaseFile::Initialize(bool calculate_hash) { |
| if (calculate_hash_) |
| secure_hash_.reset(crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
| - if (!full_path_.empty() || |
| - download_util::CreateTemporaryFileForDownload(&full_path_)) |
| - return Open(); |
| - return false; |
| + if (full_path_.empty()) { |
| + if (!file_util::CreateTemporaryFileInDir(save_path, &full_path_)) |
|
Paweł Hajdan Jr.
2011/06/15 09:31:33
nit: Instead of having a nested "if", how about ad
haraken1
2011/06/15 10:39:45
Done.
|
| + return false; |
| + } |
| + return Open(); |
| } |
| bool BaseFile::AppendDataToFile(const char* data, size_t data_len) { |