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

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

Issue 3581008: Fix instances of passing raw pointers to RefCounted objects in tasks. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Merge Created 10 years, 2 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 | « chrome/browser/download/download_file_manager.cc ('k') | chrome/browser/download/save_file_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 4e0f4ea3cd280dccee2bd3b949f1e5a9bea943b8..bb9aeea52e2e6630a80ac8eaf968321d36111fde 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -76,7 +76,7 @@ void DownloadManager::Shutdown() {
ChromeThread::PostTask(ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(file_manager_,
&DownloadFileManager::OnDownloadManagerShutdown,
- this));
+ make_scoped_refptr(this)));
}
// 'in_progress_' may contain DownloadItems that have not finished the start
@@ -446,8 +446,12 @@ void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info,
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(
- file_manager_, &DownloadFileManager::OnFinalDownloadName,
- download->id(), target_path, !info->is_dangerous, this));
+ file_manager_,
+ &DownloadFileManager::OnFinalDownloadName,
+ download->id(),
+ target_path,
+ !info->is_dangerous,
+ make_scoped_refptr(this)));
} else {
// The download hasn't finished and it is a safe download. We need to
// rename it to its intermediate '.crdownload' path.
@@ -455,8 +459,11 @@ void DownloadManager::CreateDownloadItem(DownloadCreateInfo* info,
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(
- file_manager_, &DownloadFileManager::OnIntermediateDownloadName,
- download->id(), download_path, this));
+ file_manager_,
+ &DownloadFileManager::OnIntermediateDownloadName,
+ download->id(),
+ download_path,
+ make_scoped_refptr(this)));
download->set_need_final_rename(true);
}
@@ -541,8 +548,12 @@ void DownloadManager::OnAllDataSaved(int32 download_id, int64 size) {
ChromeThread::PostTask(
ChromeThread::FILE, FROM_HERE,
NewRunnableMethod(
- file_manager_, &DownloadFileManager::OnFinalDownloadName,
- download->id(), download->full_path(), false, this));
+ file_manager_,
+ &DownloadFileManager::OnFinalDownloadName,
+ download->id(),
+ download->full_path(),
+ false,
+ make_scoped_refptr(this)));
return;
}
« no previous file with comments | « chrome/browser/download/download_file_manager.cc ('k') | chrome/browser/download/save_file_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698