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

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

Issue 2618743006: Use previous target path when resuming a download after crash (Closed)
Patch Set: remove GetLastTargetPath function Created 3 years, 11 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
Index: content/browser/download/download_item_impl_delegate.cc
diff --git a/content/browser/download/download_item_impl_delegate.cc b/content/browser/download/download_item_impl_delegate.cc
index 96be706eee0373c3021b95ce2b80db0f08bea110..272d241f1af959fbc33f5a4d6c2cd1d5d6ea053e 100644
--- a/content/browser/download/download_item_impl_delegate.cc
+++ b/content/browser/download/download_item_impl_delegate.cc
@@ -29,8 +29,11 @@ void DownloadItemImplDelegate::Detach() {
void DownloadItemImplDelegate::DetermineDownloadTarget(
DownloadItemImpl* download, const DownloadTargetCallback& callback) {
- // TODO(rdsmith/asanka): Do something useful if forced file path is null.
- base::FilePath target_path(download->GetForcedFilePath());
+ // TODO(qinmin): Do something useful if both forced file path and
+ // target file path are empty. This code path is unreachable. It's
+ // here because we cannot rely on embedder to replace the implementation.
+ base::FilePath target_path = download->GetForcedFilePath().empty() ?
asanka 2017/01/10 22:24:03 The changes in this file are not necessary. The la
qinmin 2017/01/10 23:04:42 ok, reverted the change
+ download->GetTargetFilePath() : download->GetForcedFilePath();
callback.Run(target_path,
DownloadItem::TARGET_DISPOSITION_OVERWRITE,
DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,

Powered by Google App Engine
This is Rietveld 408576698