| OLD | NEW |
| 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/base_file.h" | 5 #include "content/browser/download/base_file.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/format_macros.h" | 9 #include "base/format_macros.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 206 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 207 | 207 |
| 208 if (calculate_hash_) | 208 if (calculate_hash_) |
| 209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); | 209 secure_hash_->Finish(sha256_hash_, kSha256HashLen); |
| 210 | 210 |
| 211 Close(); | 211 Close(); |
| 212 } | 212 } |
| 213 | 213 |
| 214 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations. | 214 // OS_WIN, OS_MACOSX and OS_LINUX have specialized implementations. |
| 215 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX) | 215 #if !defined(OS_WIN) && !defined(OS_MACOSX) && !defined(OS_LINUX) |
| 216 void BaseFile::AnnotateWithSourceInformation() { | 216 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation() { |
| 217 return DOWNLOAD_INTERRUPT_REASON_NONE; |
| 217 } | 218 } |
| 218 #endif | 219 #endif |
| 219 | 220 |
| 220 int64 BaseFile::CurrentSpeed() const { | 221 int64 BaseFile::CurrentSpeed() const { |
| 221 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 222 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 222 return CurrentSpeedAtTime(base::TimeTicks::Now()); | 223 return CurrentSpeedAtTime(base::TimeTicks::Now()); |
| 223 } | 224 } |
| 224 | 225 |
| 225 bool BaseFile::GetHash(std::string* hash) { | 226 bool BaseFile::GetHash(std::string* hash) { |
| 226 DCHECK(!detached_); | 227 DCHECK(!detached_); |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 351 const char* operation, | 352 const char* operation, |
| 352 int os_error, | 353 int os_error, |
| 353 DownloadInterruptReason reason) { | 354 DownloadInterruptReason reason) { |
| 354 bound_net_log_.AddEvent( | 355 bound_net_log_.AddEvent( |
| 355 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, | 356 net::NetLog::TYPE_DOWNLOAD_FILE_ERROR, |
| 356 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); | 357 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); |
| 357 return reason; | 358 return reason; |
| 358 } | 359 } |
| 359 | 360 |
| 360 } // namespace content | 361 } // namespace content |
| OLD | NEW |