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

Unified Diff: content/browser/download/download_item_impl.cc

Issue 795353002: downloads: prevent "Clear all" from removing in progress downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: todo Created 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item_impl.cc
diff --git a/content/browser/download/download_item_impl.cc b/content/browser/download/download_item_impl.cc
index 753656fee29249a461a1830456242bbddf1e0d26..938f7cc2953c8d7e9995ad22b07a5a3fa0b726a0 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -414,7 +414,9 @@ void DownloadItemImpl::Cancel(bool user_cancel) {
if (!is_save_package_download_ && download_file_)
ReleaseDownloadFile(true);
- if (state_ == IN_PROGRESS_INTERNAL) {
+ // |request_handle_| may be NULL during tests. TODO(dbeam): inject a fake one
+ // instead?
+ if (state_ == IN_PROGRESS_INTERNAL && request_handle_) {
// Cancel the originating URL request unless it's already been cancelled
// by interrupt.
request_handle_->CancelRequest();
« no previous file with comments | « chrome/browser/ui/webui/downloads_dom_handler_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698