| 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..a17268de5871c05f77733f139b656eb2b6bd976c 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,10 @@ 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() &&
|
| + !file_util::CreateTemporaryFileInDir(save_path, &full_path_))
|
| + return false;
|
| + return Open();
|
| }
|
|
|
| bool BaseFile::AppendDataToFile(const char* data, size_t data_len) {
|
|
|