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

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

Issue 7749013: Made the cancel from CancelDownloadOnRename go through the full cancel path, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Got rid of unnecessary local variable. Created 9 years, 4 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.h ('k') | content/browser/download/download_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/download/download_item.cc
diff --git a/content/browser/download/download_item.cc b/content/browser/download/download_item.cc
index 27fa466f413ff6f5f50f318b1109d4451a6c52f4..e881f0fe7b556431d9d38a1aeb5925bd11a8f4ec 100644
--- a/content/browser/download/download_item.cc
+++ b/content/browser/download/download_item.cc
@@ -367,7 +367,7 @@ void DownloadItem::Cancel(bool update_history) {
TransitionTo(CANCELLED);
StopProgressTimer();
if (update_history)
- download_manager_->DownloadCancelled(download_id_);
+ download_manager_->DownloadCancelledInternal(this);
}
void DownloadItem::MarkAsComplete() {
@@ -703,6 +703,16 @@ FilePath DownloadItem::GetUserVerifiedFilePath() const {
GetTargetFilePath() : full_path_;
}
+void DownloadItem::OffThreadCancel(DownloadFileManager* file_manager) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
+ request_handle_.CancelRequest();
+
+ BrowserThread::PostTask(
+ BrowserThread::FILE, FROM_HERE,
+ NewRunnableMethod(
+ file_manager, &DownloadFileManager::CancelDownload, download_id_));
+}
+
void DownloadItem::Init(bool active) {
// TODO(rdsmith): Change to DCHECK after http://crbug.com/85408 resolved.
CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
« no previous file with comments | « content/browser/download/download_item.h ('k') | content/browser/download/download_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698