| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file.h" | 10 #include "base/files/file.h" |
| 11 #include "base/files/file_util.h" | 11 #include "base/files/file_util.h" |
| 12 #include "base/format_macros.h" | 12 #include "base/format_macros.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/pickle.h" | 14 #include "base/pickle.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/threading/thread_restrictions.h" | 16 #include "base/threading/thread_restrictions.h" |
| 17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
| 18 #include "content/browser/download/download_interrupt_reasons_impl.h" | 18 #include "content/browser/download/download_interrupt_reasons_impl.h" |
| 19 #include "content/browser/download/download_net_log_parameters.h" | 19 #include "content/browser/download/download_net_log_parameters.h" |
| 20 #include "content/browser/download/download_stats.h" | 20 #include "content/browser/download/download_stats.h" |
| 21 #include "content/public/browser/browser_thread.h" | 21 #include "content/public/browser/browser_thread.h" |
| 22 #include "content/public/browser/content_browser_client.h" | 22 #include "content/public/browser/content_browser_client.h" |
| 23 #include "crypto/secure_hash.h" | 23 #include "crypto/secure_hash.h" |
| 24 #include "net/base/net_errors.h" | 24 #include "net/base/net_errors.h" |
| 25 #include "net/log/net_log.h" | 25 #include "net/log/net_log.h" |
| 26 #include "net/log/net_log_event_type.h" | 26 #include "net/log/net_log_event_type.h" |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 | 29 |
| 30 BaseFile::BaseFile(const net::BoundNetLog& bound_net_log) | 30 BaseFile::BaseFile(const net::NetLogWithSource& bound_net_log) |
| 31 : bound_net_log_(bound_net_log) {} | 31 : bound_net_log_(bound_net_log) {} |
| 32 | 32 |
| 33 BaseFile::~BaseFile() { | 33 BaseFile::~BaseFile() { |
| 34 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 34 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 35 if (detached_) | 35 if (detached_) |
| 36 Close(); | 36 Close(); |
| 37 else | 37 else |
| 38 Cancel(); // Will delete the file. | 38 Cancel(); // Will delete the file. |
| 39 } | 39 } |
| 40 | 40 |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 378 DVLOG(1) << __func__ << "() operation:" << operation | 378 DVLOG(1) << __func__ << "() operation:" << operation |
| 379 << " os_error:" << os_error | 379 << " os_error:" << os_error |
| 380 << " reason:" << DownloadInterruptReasonToString(reason); | 380 << " reason:" << DownloadInterruptReasonToString(reason); |
| 381 bound_net_log_.AddEvent( | 381 bound_net_log_.AddEvent( |
| 382 net::NetLogEventType::DOWNLOAD_FILE_ERROR, | 382 net::NetLogEventType::DOWNLOAD_FILE_ERROR, |
| 383 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); | 383 base::Bind(&FileInterruptedNetLogCallback, operation, os_error, reason)); |
| 384 return reason; | 384 return reason; |
| 385 } | 385 } |
| 386 | 386 |
| 387 } // namespace content | 387 } // namespace content |
| OLD | NEW |