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

Side by Side 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 unified diff | Download patch
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_item_impl_delegate.h" 5 #include "content/browser/download/download_item_impl_delegate.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "content/browser/download/download_item_impl.h" 8 #include "content/browser/download/download_item_impl.h"
9 9
10 namespace content { 10 namespace content {
(...skipping 11 matching lines...) Expand all
22 ++count_; 22 ++count_;
23 } 23 }
24 24
25 void DownloadItemImplDelegate::Detach() { 25 void DownloadItemImplDelegate::Detach() {
26 DCHECK_LT(0, count_); 26 DCHECK_LT(0, count_);
27 --count_; 27 --count_;
28 } 28 }
29 29
30 void DownloadItemImplDelegate::DetermineDownloadTarget( 30 void DownloadItemImplDelegate::DetermineDownloadTarget(
31 DownloadItemImpl* download, const DownloadTargetCallback& callback) { 31 DownloadItemImpl* download, const DownloadTargetCallback& callback) {
32 // TODO(rdsmith/asanka): Do something useful if forced file path is null. 32 // TODO(qinmin): Do something useful if both forced file path and
33 base::FilePath target_path(download->GetForcedFilePath()); 33 // target file path are empty. This code path is unreachable. It's
34 // here because we cannot rely on embedder to replace the implementation.
35 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
36 download->GetTargetFilePath() : download->GetForcedFilePath();
34 callback.Run(target_path, 37 callback.Run(target_path,
35 DownloadItem::TARGET_DISPOSITION_OVERWRITE, 38 DownloadItem::TARGET_DISPOSITION_OVERWRITE,
36 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 39 DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
37 target_path); 40 target_path);
38 } 41 }
39 42
40 bool DownloadItemImplDelegate::ShouldCompleteDownload( 43 bool DownloadItemImplDelegate::ShouldCompleteDownload(
41 DownloadItemImpl* download, 44 DownloadItemImpl* download,
42 const base::Closure& complete_callback) { 45 const base::Closure& complete_callback) {
43 return true; 46 return true;
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 78
76 void DownloadItemImplDelegate::ShowDownloadInShell(DownloadItemImpl* download) { 79 void DownloadItemImplDelegate::ShowDownloadInShell(DownloadItemImpl* download) {
77 } 80 }
78 81
79 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {} 82 void DownloadItemImplDelegate::DownloadRemoved(DownloadItemImpl* download) {}
80 83
81 void DownloadItemImplDelegate::AssertStateConsistent( 84 void DownloadItemImplDelegate::AssertStateConsistent(
82 DownloadItemImpl* download) const {} 85 DownloadItemImpl* download) const {}
83 86
84 } // namespace content 87 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698