| 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_manager_impl.h" | 5 #include "content/browser/download/download_manager_impl.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 353 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 364 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, | 364 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, |
| 365 &default_download_directory, &skip_dir_check); | 365 &default_download_directory, &skip_dir_check); |
| 366 } | 366 } |
| 367 | 367 |
| 368 std::unique_ptr<DownloadFile> download_file; | 368 std::unique_ptr<DownloadFile> download_file; |
| 369 | 369 |
| 370 if (info->result == DOWNLOAD_INTERRUPT_REASON_NONE) { | 370 if (info->result == DOWNLOAD_INTERRUPT_REASON_NONE) { |
| 371 DCHECK(stream.get()); | 371 DCHECK(stream.get()); |
| 372 download_file.reset(file_factory_->CreateFile( | 372 download_file.reset(file_factory_->CreateFile( |
| 373 std::move(info->save_info), default_download_directory, | 373 std::move(info->save_info), default_download_directory, |
| 374 std::move(stream), download->GetNetLogWithSource(), | 374 std::move(stream), download->GetReceivedSlices(), |
| 375 download->GetNetLogWithSource(), |
| 375 download->DestinationObserverAsWeakPtr())); | 376 download->DestinationObserverAsWeakPtr())); |
| 376 } | 377 } |
| 377 // It is important to leave info->save_info intact in the case of an interrupt | 378 // It is important to leave info->save_info intact in the case of an interrupt |
| 378 // so that the DownloadItem can salvage what it can out of a failed resumption | 379 // so that the DownloadItem can salvage what it can out of a failed resumption |
| 379 // attempt. | 380 // attempt. |
| 380 | 381 |
| 381 download->Start(std::move(download_file), std::move(info->request_handle), | 382 download->Start(std::move(download_file), std::move(info->request_handle), |
| 382 *info); | 383 *info); |
| 383 | 384 |
| 384 // For interrupted downloads, Start() will transition the state to | 385 // For interrupted downloads, Start() will transition the state to |
| (...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 746 if (delegate_) | 747 if (delegate_) |
| 747 delegate_->OpenDownload(download); | 748 delegate_->OpenDownload(download); |
| 748 } | 749 } |
| 749 | 750 |
| 750 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 751 if (delegate_) | 752 if (delegate_) |
| 752 delegate_->ShowDownloadInShell(download); | 753 delegate_->ShowDownloadInShell(download); |
| 753 } | 754 } |
| 754 | 755 |
| 755 } // namespace content | 756 } // namespace content |
| OLD | NEW |