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

Unified Diff: content/browser/download/base_file.cc

Issue 10912173: Replace the DownloadFileManager with direct ownership of DownloadFileImpl (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to LKGR (r162700) 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/download_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « content/browser/download/base_file.h ('k') | content/browser/download/download_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698