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

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

Issue 16924017: A few minor changes to the chrome.downloads extension API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: @r214130 Created 7 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 | « content/browser/download/download_item_impl.h ('k') | content/public/browser/download_item.h » ('j') | 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 5471df24938ac9cc0b92586801ae4b7568f8c0fe..b49a256f31e78d320cae7d25ea8433a350efc81d 100644
--- a/content/browser/download/download_item_impl.cc
+++ b/content/browser/download/download_item_impl.cc
@@ -608,6 +608,20 @@ bool DownloadItemImpl::GetFileExternallyRemoved() const {
return file_externally_removed_;
}
+void DownloadItemImpl::DeleteFile() {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ if ((GetState() != DownloadItem::COMPLETE) ||
+ file_externally_removed_) {
+ return;
+ }
+ BrowserThread::PostTaskAndReply(
+ BrowserThread::FILE, FROM_HERE,
+ base::Bind(&DeleteDownloadedFile, current_path_),
+ base::Bind(&DownloadItemImpl::OnDownloadedFileRemoved,
+ weak_ptr_factory_.GetWeakPtr()));
+ current_path_.clear();
+}
+
bool DownloadItemImpl::IsDangerous() const {
#if defined(OS_WIN)
// TODO(noelutz): At this point only the windows views UI supports
« no previous file with comments | « content/browser/download/download_item_impl.h ('k') | content/public/browser/download_item.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698