Index: content/browser/download/base_file.cc |
diff --git a/content/browser/download/base_file.cc b/content/browser/download/base_file.cc |
index cad472f5adc3c337afba57b871a5d9b9098c8ba9..6cbe98e3eb0fbf0d3334a6238ecf2d16fadb27f0 100644 |
--- a/content/browser/download/base_file.cc |
+++ b/content/browser/download/base_file.cc |
@@ -220,13 +220,7 @@ BaseFile::BaseFile(const FilePath& full_path, |
calculate_hash_(calculate_hash), |
detached_(false), |
bound_net_log_(bound_net_log) { |
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
memcpy(sha256_hash_, kEmptySha256Hash, kSha256HashLen); |
- if (file_stream_.get()) { |
- file_stream_->SetBoundNetLogSource(bound_net_log_); |
- file_stream_->EnableErrorStatistics(); |
- } |
- |
if (calculate_hash_) { |
secure_hash_.reset(crypto::SecureHash::Create(crypto::SecureHash::SHA256)); |
if ((bytes_so_far_ > 0) && // Not starting at the beginning. |
@@ -249,6 +243,11 @@ net::Error BaseFile::Initialize(const FilePath& default_directory) { |
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
DCHECK(!detached_); |
+ if (file_stream_.get()) { |
+ file_stream_->SetBoundNetLogSource(bound_net_log_); |
+ file_stream_->EnableErrorStatistics(); |
+ } |
+ |
if (full_path_.empty()) { |
FilePath initial_directory(default_directory); |
FilePath temp_file; |