Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Side by Side Diff: content/browser/download/download_manager_impl.cc

Issue 1544653002: [Download] Treat RESUMING_INTERNAL as IN_PROGRESS in DownloadItem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@unify-downloader-core
Patch Set: Establishing dependency on other fixes. Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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()); 387 DCHECK_EQ(download->GetState(), DownloadItem::IN_PROGRESS);
388 download->MergeOriginInfoOnResume(*info); 388 download->MergeOriginInfoOnResume(*info);
389 } 389 }
390 390
391 base::FilePath default_download_directory; 391 base::FilePath default_download_directory;
392 if (delegate_) { 392 if (delegate_) {
393 base::FilePath website_save_directory; // Unused 393 base::FilePath website_save_directory; // Unused
394 bool skip_dir_check = false; // Unused 394 bool skip_dir_check = false; // Unused
395 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory, 395 delegate_->GetSaveDir(GetBrowserContext(), &website_save_directory,
396 &default_download_directory, &skip_dir_check); 396 &default_download_directory, &skip_dir_check);
397 } 397 }
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after
747 if (delegate_) 747 if (delegate_)
748 delegate_->OpenDownload(download); 748 delegate_->OpenDownload(download);
749 } 749 }
750 750
751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) { 751 void DownloadManagerImpl::ShowDownloadInShell(DownloadItemImpl* download) {
752 if (delegate_) 752 if (delegate_)
753 delegate_->ShowDownloadInShell(download); 753 delegate_->ShowDownloadInShell(download);
754 } 754 }
755 755
756 } // namespace content 756 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_item_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698