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

Unified Diff: chrome/browser/download/download_target_determiner.cc

Issue 2166163003: Fix a Use-after-free bug (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix another violation missed earlier Created 4 years, 5 months 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_target_determiner.cc
diff --git a/chrome/browser/download/download_target_determiner.cc b/chrome/browser/download/download_target_determiner.cc
index 07f13da57e43d0dcaf49177520702e5ac59969e8..61e60954e19267ded484b05564cc633cb65a9b04 100644
--- a/chrome/browser/download/download_target_determiner.cc
+++ b/chrome/browser/download/download_target_determiner.cc
@@ -324,9 +324,9 @@ void DownloadTargetDeterminer::ReserveVirtualPathDone(
#if BUILDFLAG(ANDROID_JAVA_UI)
if (!verified) {
if (path.empty()) {
- CancelOnFailureAndDeleteSelf();
DownloadManagerService::OnDownloadCanceled(
download_, DownloadController::CANCEL_REASON_NO_EXTERNAL_STORAGE);
+ CancelOnFailureAndDeleteSelf();
return;
}
if (!download_->GetWebContents()) {
@@ -334,10 +334,10 @@ void DownloadTargetDeterminer::ReserveVirtualPathDone(
// is no way to prompt user for an infobar. This could happen after chrome
// gets killed, and user tries to resume a download while another app has
// created the target file (not the temporary .crdownload file).
- CancelOnFailureAndDeleteSelf();
DownloadManagerService::OnDownloadCanceled(
download_,
DownloadController::CANCEL_REASON_CANNOT_DETERMINE_DOWNLOAD_TARGET);
+ CancelOnFailureAndDeleteSelf();
return;
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698