| 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/download_file_impl.h" | 5 #include "content/browser/download/download_file_impl.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 } | 193 } |
| 194 | 194 |
| 195 bool DownloadFileImpl::GetHash(std::string* hash) { | 195 bool DownloadFileImpl::GetHash(std::string* hash) { |
| 196 return file_.GetHash(hash); | 196 return file_.GetHash(hash); |
| 197 } | 197 } |
| 198 | 198 |
| 199 std::string DownloadFileImpl::GetHashState() { | 199 std::string DownloadFileImpl::GetHashState() { |
| 200 return file_.GetHashState(); | 200 return file_.GetHashState(); |
| 201 } | 201 } |
| 202 | 202 |
| 203 void DownloadFileImpl::SetClientGuid(const std::string& guid) { |
| 204 file_.SetClientGuid(guid); |
| 205 } |
| 206 |
| 203 void DownloadFileImpl::StreamActive() { | 207 void DownloadFileImpl::StreamActive() { |
| 204 base::TimeTicks start(base::TimeTicks::Now()); | 208 base::TimeTicks start(base::TimeTicks::Now()); |
| 205 base::TimeTicks now; | 209 base::TimeTicks now; |
| 206 scoped_refptr<net::IOBuffer> incoming_data; | 210 scoped_refptr<net::IOBuffer> incoming_data; |
| 207 size_t incoming_data_size = 0; | 211 size_t incoming_data_size = 0; |
| 208 size_t total_incoming_data_size = 0; | 212 size_t total_incoming_data_size = 0; |
| 209 size_t num_buffers = 0; | 213 size_t num_buffers = 0; |
| 210 ByteStreamReader::StreamState state(ByteStreamReader::STREAM_EMPTY); | 214 ByteStreamReader::StreamState state(ByteStreamReader::STREAM_EMPTY); |
| 211 DownloadInterruptReason reason = DOWNLOAD_INTERRUPT_REASON_NONE; | 215 DownloadInterruptReason reason = DOWNLOAD_INTERRUPT_REASON_NONE; |
| 212 base::TimeDelta delta( | 216 base::TimeDelta delta( |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 308 observer_, file_.bytes_so_far(), CurrentSpeed(), | 312 observer_, file_.bytes_so_far(), CurrentSpeed(), |
| 309 GetHashState())); | 313 GetHashState())); |
| 310 } | 314 } |
| 311 | 315 |
| 312 // static | 316 // static |
| 313 int DownloadFile::GetNumberOfDownloadFiles() { | 317 int DownloadFile::GetNumberOfDownloadFiles() { |
| 314 return number_active_objects_; | 318 return number_active_objects_; |
| 315 } | 319 } |
| 316 | 320 |
| 317 } // namespace content | 321 } // namespace content |
| OLD | NEW |