Chromium Code Reviews| 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 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 377 (item_iterator->second->GetState() == DownloadItem::CANCELLED)) { | 377 (item_iterator->second->GetState() == DownloadItem::CANCELLED)) { |
| 378 // If the download is no longer known to the DownloadManager, then it was | 378 // If the download is no longer known to the DownloadManager, then it was |
| 379 // removed after it was resumed. Ignore. If the download is cancelled | 379 // removed after it was resumed. Ignore. If the download is cancelled |
| 380 // while resuming, then also ignore the request. | 380 // while resuming, then also ignore the request. |
| 381 info->request_handle->CancelRequest(); | 381 info->request_handle->CancelRequest(); |
| 382 if (!on_started.is_null()) | 382 if (!on_started.is_null()) |
| 383 on_started.Run(NULL, DOWNLOAD_INTERRUPT_REASON_USER_CANCELED); | 383 on_started.Run(NULL, DOWNLOAD_INTERRUPT_REASON_USER_CANCELED); |
| 384 return; | 384 return; |
| 385 } | 385 } |
| 386 download = item_iterator->second; | 386 download = item_iterator->second; |
| 387 DCHECK_EQ(DownloadItem::INTERRUPTED, download->GetState()); | |
|
svaldez
2015/12/21 21:18:44
Not DCHECK(IN_PROGRESS)?
asanka
2015/12/21 21:46:11
I chose to remove this because the MergeOriginInfo
svaldez
2015/12/21 21:54:01
Acknowledged.
| |
| 388 download->MergeOriginInfoOnResume(*info); | 387 download->MergeOriginInfoOnResume(*info); |
| 389 } | 388 } |
| 390 | 389 |
| 391 base::FilePath default_download_directory; | 390 base::FilePath default_download_directory; |
| 392 if (delegate_) { | 391 if (delegate_) { |
| 393 base::FilePath website_save_directory; // Unused | 392 base::FilePath website_save_directory; // Unused |
| 394 bool skip_dir_check = false; // Unused | 393 bool skip_dir_check = false; // Unused |
| 395 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, | 394 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, |
| 396 &default_download_directory, &skip_dir_check); | 395 &default_download_directory, &skip_dir_check); |
| 397 } | 396 } |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 747 if (delegate_) | 746 if (delegate_) |
| 748 delegate_->OpenDownload(download); | 747 delegate_->OpenDownload(download); |
| 749 } | 748 } |
| 750 | 749 |
| 751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { | 750 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { |
| 752 if (delegate_) | 751 if (delegate_) |
| 753 delegate_->ShowDownloadInShell(download); | 752 delegate_->ShowDownloadInShell(download); |
| 754 } | 753 } |
| 755 | 754 |
| 756 } // namespace content | 755 } // namespace content |
| OLD | NEW |