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

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

Issue 7112011: Change DownloadProcessHandle to be more of an encapsulated class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Get rid of cancel code in download_util. Created 9 years, 7 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: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index 58090f2d492e18f00c5dc16dca08589f9e43e6e1..46c6073cdd4b20e4afaacfa7fc636d3021000fd2 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -755,9 +755,7 @@ void DownloadManager::DownloadCancelled(int32 download_id) {
void DownloadManager::DownloadCancelledInternal(
int download_id, DownloadProcessHandle process_handle) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
- // Cancel the network request. RDH is guaranteed to outlive the IO thread.
hendrickson_a 2011/06/04 16:01:45 I'd like this comment to be preserved (in download
Randy Smith (Not in Mondays) 2011/06/07 22:41:11 Done.
- download_util::CancelDownloadRequest(
- g_browser_process->resource_dispatcher_host(), process_handle);
+ process_handle.CancelRequest();
BrowserThread::PostTask(
BrowserThread::FILE, FROM_HERE,
@@ -801,38 +799,11 @@ void DownloadManager::OnDownloadError(int32 download_id,
file_manager_, &DownloadFileManager::CancelDownload, download_id));
}
-void DownloadManager::PauseDownload(int32 download_id, bool pause) {
- DownloadMap::iterator it = in_progress_.find(download_id);
- if (it == in_progress_.end())
- return;
-
- DownloadItem* download = it->second;
- if (pause == download->is_paused())
- return;
-
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- NewRunnableMethod(this,
- &DownloadManager::PauseDownloadRequest,
- g_browser_process->resource_dispatcher_host(),
- download->process_handle(),
- pause));
-}
-
void DownloadManager::UpdateAppIcon() {
if (status_updater_)
status_updater_->Update();
}
-void DownloadManager::PauseDownloadRequest(ResourceDispatcherHost* rdh,
- DownloadProcessHandle process_handle,
- bool pause) {
- DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
- rdh->PauseRequest(process_handle.child_id(),
- process_handle.request_id(),
- pause);
-}
-
void DownloadManager::RemoveDownload(int64 download_handle) {
DownloadMap::iterator it = history_downloads_.find(download_handle);
if (it == history_downloads_.end())

Powered by Google App Engine
This is Rietveld 408576698