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

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

Issue 6932046: Added DownloadProcessHandle class. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: download_process_handle Created 9 years, 8 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_file.cc
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index 629ee117a95e44d2008f1fc727b722d965f4cffb..051346a23b38069ef5df2fda408f0c257a4c84d2 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -9,7 +9,6 @@
#include "base/file_util.h"
#include "base/stringprintf.h"
#include "chrome/browser/download/download_manager.h"
-#include "chrome/browser/download/download_util.h"
#include "chrome/browser/history/download_create_info.h"
#include "content/browser/browser_thread.h"
@@ -21,8 +20,7 @@ DownloadFile::DownloadFile(const DownloadCreateInfo* info,
info->received_bytes,
info->save_info.file_stream),
id_(info->download_id),
- child_id_(info->child_id),
- request_id_(info->request_id),
+ process_handle_(info->process_handle),
download_manager_(download_manager) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -34,12 +32,7 @@ DownloadFile::~DownloadFile() {
void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
- BrowserThread::PostTask(
- BrowserThread::IO, FROM_HERE,
- NewRunnableFunction(&download_util::CancelDownloadRequest,
- rdh,
- child_id_,
- request_id_));
+ process_handle_.CancelDownload(rdh);
}
DownloadManager* DownloadFile::GetDownloadManager() {
@@ -49,15 +42,15 @@ DownloadManager* DownloadFile::GetDownloadManager() {
std::string DownloadFile::DebugString() const {
return base::StringPrintf("{"
- " full_path_ = " "\"%s\""
" id_ = " "%d"
- " child_id_ = " "%d"
- " request_id_ = " "%d"
+ " child_id = " "%d"
+ " request_id = " "%d"
+ " render_view_id = " "%d"
" Base File = %s"
" }",
- full_path_.value().c_str(),
id_,
- child_id_,
- request_id_,
+ process_handle_.child_id(),
+ process_handle_.request_id(),
+ process_handle_.render_view_id(),
BaseFile::DebugString().c_str());
}

Powered by Google App Engine
This is Rietveld 408576698