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

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

Issue 3245005: GTTF: Clean up DownloadFileManager (Closed)
Patch Set: fixes Created 10 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 | « chrome/browser/download/download_file.h ('k') | chrome/browser/download/download_file_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_file.cc
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index c877a6e5fe0b37feb0468ed0450f73cb527eab4e..ab563802f26d0c9bd4a327f24b9ab6abdc5b8044 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -10,15 +10,19 @@
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/history/download_types.h"
-DownloadFile::DownloadFile(const DownloadCreateInfo* info)
+DownloadFile::DownloadFile(const DownloadCreateInfo* info,
+ DownloadManager* download_manager)
: BaseFile(info->save_info.file_path,
info->url,
info->referrer_url,
+ info->received_bytes,
info->save_info.file_stream),
id_(info->download_id),
child_id_(info->child_id),
- request_id_(info->request_id) {
+ request_id_(info->request_id),
+ download_manager_(download_manager) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+
}
DownloadFile::~DownloadFile() {
@@ -40,3 +44,13 @@ void DownloadFile::CancelDownloadRequest(ResourceDispatcherHost* rdh) {
child_id_,
request_id_));
}
+
+void DownloadFile::OnDownloadManagerShutdown() {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ download_manager_ = NULL;
+}
+
+DownloadManager* DownloadFile::GetDownloadManager() {
+ DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE));
+ return download_manager_.get();
+}
« no previous file with comments | « chrome/browser/download/download_file.h ('k') | chrome/browser/download/download_file_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698