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/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 } | 237 } |
238 | 238 |
239 std::string DownloadFileImpl::GetHashState() { | 239 std::string DownloadFileImpl::GetHashState() { |
240 return file_.GetHashState(); | 240 return file_.GetHashState(); |
241 } | 241 } |
242 | 242 |
243 void DownloadFileImpl::SetClientGuid(const std::string& guid) { | 243 void DownloadFileImpl::SetClientGuid(const std::string& guid) { |
244 file_.SetClientGuid(guid); | 244 file_.SetClientGuid(guid); |
245 } | 245 } |
246 | 246 |
| 247 void DownloadFileImpl::SetHideFileExtension(bool hide_extension) { |
| 248 file_.set_hide_file_extension(hide_extension); |
| 249 } |
| 250 |
247 void DownloadFileImpl::StreamActive() { | 251 void DownloadFileImpl::StreamActive() { |
248 base::TimeTicks start(base::TimeTicks::Now()); | 252 base::TimeTicks start(base::TimeTicks::Now()); |
249 base::TimeTicks now; | 253 base::TimeTicks now; |
250 scoped_refptr<net::IOBuffer> incoming_data; | 254 scoped_refptr<net::IOBuffer> incoming_data; |
251 size_t incoming_data_size = 0; | 255 size_t incoming_data_size = 0; |
252 size_t total_incoming_data_size = 0; | 256 size_t total_incoming_data_size = 0; |
253 size_t num_buffers = 0; | 257 size_t num_buffers = 0; |
254 ByteStreamReader::StreamState state(ByteStreamReader::STREAM_EMPTY); | 258 ByteStreamReader::StreamState state(ByteStreamReader::STREAM_EMPTY); |
255 DownloadInterruptReason reason = DOWNLOAD_INTERRUPT_REASON_NONE; | 259 DownloadInterruptReason reason = DOWNLOAD_INTERRUPT_REASON_NONE; |
256 base::TimeDelta delta( | 260 base::TimeDelta delta( |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 observer_, file_.bytes_so_far(), CurrentSpeed(), | 356 observer_, file_.bytes_so_far(), CurrentSpeed(), |
353 GetHashState())); | 357 GetHashState())); |
354 } | 358 } |
355 | 359 |
356 // static | 360 // static |
357 int DownloadFile::GetNumberOfDownloadFiles() { | 361 int DownloadFile::GetNumberOfDownloadFiles() { |
358 return number_active_objects_; | 362 return number_active_objects_; |
359 } | 363 } |
360 | 364 |
361 } // namespace content | 365 } // namespace content |
OLD | NEW |