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

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

Issue 9296012: Hooked up NetLog to DownloadItem, DownloadFile, and FileStream. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk Created 8 years, 10 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: content/browser/download/download_file_manager.cc
diff --git a/content/browser/download/download_file_manager.cc b/content/browser/download/download_file_manager.cc
index 1b360af53f73decee7f14e4f551611d2738bc6dc..a0a6c46ddfc7bf454af9835127b3b8dcd8d88fbd 100644
--- a/content/browser/download/download_file_manager.cc
+++ b/content/browser/download/download_file_manager.cc
@@ -46,17 +46,20 @@ class DownloadFileFactoryImpl
DownloadCreateInfo* info,
const DownloadRequestHandle& request_handle,
DownloadManager* download_manager,
- bool calculate_hash) OVERRIDE;
+ bool calculate_hash,
+ const net::BoundNetLog& bound_net_log) OVERRIDE;
};
DownloadFile* DownloadFileFactoryImpl::CreateFile(
DownloadCreateInfo* info,
const DownloadRequestHandle& request_handle,
DownloadManager* download_manager,
- bool calculate_hash) {
+ bool calculate_hash,
+ const net::BoundNetLog& bound_net_log) {
return new DownloadFileImpl(info,
new DownloadRequestHandle(request_handle),
- download_manager, calculate_hash);
+ download_manager, calculate_hash,
+ bound_net_log);
}
} // namespace
@@ -87,7 +90,8 @@ void DownloadFileManager::OnShutdown() {
void DownloadFileManager::CreateDownloadFile(
DownloadCreateInfo* info, const DownloadRequestHandle& request_handle,
- DownloadManager* download_manager, bool get_hash) {
+ DownloadManager* download_manager, bool get_hash,
+ const net::BoundNetLog& bound_net_log) {
DCHECK(info);
VLOG(20) << __FUNCTION__ << "()" << " info = " << info->DebugString();
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
@@ -96,7 +100,7 @@ void DownloadFileManager::CreateDownloadFile(
scoped_ptr<DownloadCreateInfo> infop(info);
scoped_ptr<DownloadFile> download_file(download_file_factory_->CreateFile(
- info, request_handle, download_manager, get_hash));
+ info, request_handle, download_manager, get_hash, bound_net_log));
if (net::OK != download_file->Initialize()) {
request_handle.CancelRequest();
return;
@@ -167,13 +171,16 @@ void DownloadFileManager::StartDownload(
return;
}
- manager->CreateDownloadItem(info, request_handle);
+ // |bound_net_log| will be used for logging the both the download item's and
+ // the download file's events.
+ net::BoundNetLog bound_net_log =
+ manager->CreateDownloadItem(info, request_handle);
bool hash_needed = manager->GenerateFileHash();
BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
base::Bind(&DownloadFileManager::CreateDownloadFile, this,
info, request_handle, make_scoped_refptr(manager),
- hash_needed));
+ hash_needed, bound_net_log));
}
// We don't forward an update to the UI thread here, since we want to throttle
« no previous file with comments | « content/browser/download/download_file_manager.h ('k') | content/browser/download/download_file_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698