| 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" |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 // Update status. | 110 // Update status. |
| 111 size_t write_size = static_cast<size_t>(write_result); | 111 size_t write_size = static_cast<size_t>(write_result); |
| 112 DCHECK_LE(write_size, len); | 112 DCHECK_LE(write_size, len); |
| 113 len -= write_size; | 113 len -= write_size; |
| 114 current_data += write_size; | 114 current_data += write_size; |
| 115 bytes_so_far_ += write_size; | 115 bytes_so_far_ += write_size; |
| 116 } | 116 } |
| 117 net_log_.EndEvent(net::NetLogEventType::DOWNLOAD_FILE_WRITTEN, | 117 net_log_.EndEvent(net::NetLogEventType::DOWNLOAD_FILE_WRITTEN, |
| 118 net::NetLog::Int64Callback("bytes", data_len)); | 118 net::NetLog::Int64Callback("bytes", data_len)); |
| 119 | 119 |
| 120 RecordDownloadWriteSize(data_len); | |
| 121 RecordDownloadWriteLoopCount(write_count); | |
| 122 | |
| 123 if (secure_hash_) | 120 if (secure_hash_) |
| 124 secure_hash_->Update(data, data_len); | 121 secure_hash_->Update(data, data_len); |
| 125 | 122 |
| 126 return DOWNLOAD_INTERRUPT_REASON_NONE; | 123 return DOWNLOAD_INTERRUPT_REASON_NONE; |
| 127 } | 124 } |
| 128 | 125 |
| 129 DownloadInterruptReason BaseFile::Rename(const base::FilePath& new_path) { | 126 DownloadInterruptReason BaseFile::Rename(const base::FilePath& new_path) { |
| 130 DCHECK_CURRENTLY_ON(BrowserThread::FILE); | 127 DCHECK_CURRENTLY_ON(BrowserThread::FILE); |
| 131 DownloadInterruptReason rename_result = DOWNLOAD_INTERRUPT_REASON_NONE; | 128 DownloadInterruptReason rename_result = DOWNLOAD_INTERRUPT_REASON_NONE; |
| 132 | 129 |
| (...skipping 326 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 #else // !OS_WIN && !OS_MACOSX && !OS_LINUX | 456 #else // !OS_WIN && !OS_MACOSX && !OS_LINUX |
| 460 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation( | 457 DownloadInterruptReason BaseFile::AnnotateWithSourceInformation( |
| 461 const std::string& client_guid, | 458 const std::string& client_guid, |
| 462 const GURL& source_url, | 459 const GURL& source_url, |
| 463 const GURL& referrer_url) { | 460 const GURL& referrer_url) { |
| 464 return DOWNLOAD_INTERRUPT_REASON_NONE; | 461 return DOWNLOAD_INTERRUPT_REASON_NONE; |
| 465 } | 462 } |
| 466 #endif | 463 #endif |
| 467 | 464 |
| 468 } // namespace content | 465 } // namespace content |
| OLD | NEW |