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 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 24 matching lines...) Expand all Loading... |
35 // initial delay is specified by kInitialRenameRetryDelayMs. | 35 // initial delay is specified by kInitialRenameRetryDelayMs. |
36 const int kInitialRenameRetryDelayMs = 200; | 36 const int kInitialRenameRetryDelayMs = 200; |
37 | 37 |
38 // Number of times a failing rename is retried before giving up. | 38 // Number of times a failing rename is retried before giving up. |
39 const int kMaxRenameRetries = 3; | 39 const int kMaxRenameRetries = 3; |
40 | 40 |
41 DownloadFileImpl::DownloadFileImpl( | 41 DownloadFileImpl::DownloadFileImpl( |
42 std::unique_ptr<DownloadSaveInfo> save_info, | 42 std::unique_ptr<DownloadSaveInfo> save_info, |
43 const base::FilePath& default_download_directory, | 43 const base::FilePath& default_download_directory, |
44 std::unique_ptr<ByteStreamReader> stream, | 44 std::unique_ptr<ByteStreamReader> stream, |
45 const net::BoundNetLog& download_item_net_log, | 45 const net::NetLogWithSource& download_item_net_log, |
46 base::WeakPtr<DownloadDestinationObserver> observer) | 46 base::WeakPtr<DownloadDestinationObserver> observer) |
47 : bound_net_log_( | 47 : bound_net_log_( |
48 net::BoundNetLog::Make(download_item_net_log.net_log(), | 48 net::NetLogWithSource::Make(download_item_net_log.net_log(), |
49 net::NetLogSourceType::DOWNLOAD_FILE)), | 49 net::NetLogSourceType::DOWNLOAD_FILE)), |
50 file_(bound_net_log_), | 50 file_(bound_net_log_), |
51 save_info_(std::move(save_info)), | 51 save_info_(std::move(save_info)), |
52 default_download_directory_(default_download_directory), | 52 default_download_directory_(default_download_directory), |
53 stream_reader_(std::move(stream)), | 53 stream_reader_(std::move(stream)), |
54 bytes_seen_(0), | 54 bytes_seen_(0), |
55 observer_(observer), | 55 observer_(observer), |
56 weak_factory_(this) { | 56 weak_factory_(this) { |
57 download_item_net_log.AddEvent( | 57 download_item_net_log.AddEvent( |
58 net::NetLogEventType::DOWNLOAD_FILE_CREATED, | 58 net::NetLogEventType::DOWNLOAD_FILE_CREATED, |
59 bound_net_log_.source().ToEventParametersCallback()); | 59 bound_net_log_.source().ToEventParametersCallback()); |
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
356 const base::FilePath& new_path, | 356 const base::FilePath& new_path, |
357 const RenameCompletionCallback& completion_callback) | 357 const RenameCompletionCallback& completion_callback) |
358 : option(option), | 358 : option(option), |
359 new_path(new_path), | 359 new_path(new_path), |
360 retries_left(kMaxRenameRetries), | 360 retries_left(kMaxRenameRetries), |
361 completion_callback(completion_callback) {} | 361 completion_callback(completion_callback) {} |
362 | 362 |
363 DownloadFileImpl::RenameParameters::~RenameParameters() {} | 363 DownloadFileImpl::RenameParameters::~RenameParameters() {} |
364 | 364 |
365 } // namespace content | 365 } // namespace content |
OLD | NEW |