summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download
diff options
context:
space:
mode:
authorahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 21:48:08 +0000
committerahendrickson@chromium.org <ahendrickson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-02-08 21:48:08 +0000
commit698459744a124180f38df86d5b4a7d89aad2d7ca (patch)
tree32b75ae1cf90aa6ba30d3ad08091a353a80e6533 /chrome/browser/download
parentebf7966effc5b6ddc656bf826fabab0d4315cee7 (diff)
downloadchromium_src-698459744a124180f38df86d5b4a7d89aad2d7ca.zip
chromium_src-698459744a124180f38df86d5b4a7d89aad2d7ca.tar.gz
chromium_src-698459744a124180f38df86d5b4a7d89aad2d7ca.tar.bz2
Hooked up NetLog to DownloadItem, DownloadFile, and FileStream.
The ChromeNetLog object is owned by the browser process, which has a longer lifetime than the profile and therefore than the download system. For each download, there will be one BoundNetLog (or a copy thereof) used by DownloadItem and DownloadFile, and one separate one used by FileStream. For most downloads, the path to get a NetLog pointer to the download objects (DownloadItem, DownloadFile and FileStream) is through the URL request. A BoundNetLog is created and passed in to the DownloadResourceHandler constructor, which adds it to a DownloadCreateInfo that it makes. This gets it to DownloadItem, DownloadFile/BaseFile, and FileStream. For downloads created from the history database, the path is via the DownloadService and the DownloadManager constructor. Likewise for downloads created as part of a 'Save Page As' operation, although that may change in the future with further refactoring of the 'Save Page As' code. For downloads initiated by drag & drop on Linux and Mac (but not on Windows), the FileStream needs to get a NetLog pointer from another source. In this case, it is via the ContentClient (effectively a global) and ContentBrowserClient classes. Note that FileStream has a different NetLog source than the other classes. This is the final of 4 CLs that will enable net logging for downloads. BUG=None TEST=Go to a web page with downloadable content. Open a new tab with about:net-internals. Download a file. Check the EVENTS tab of about:net-internals: there should be DOWNLOAD and FILESTREAM events. Review URL: http://codereview.chromium.org/9296012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121050 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download')
-rw-r--r--chrome/browser/download/download_service.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/chrome/browser/download/download_service.cc b/chrome/browser/download/download_service.cc
index b58e0c2..1fd1908 100644
--- a/chrome/browser/download/download_service.cc
+++ b/chrome/browser/download/download_service.cc
@@ -9,6 +9,7 @@
#include "chrome/browser/download/chrome_download_manager_delegate.h"
#include "chrome/browser/download/download_service_factory.h"
#include "chrome/browser/download/download_status_updater.h"
+#include "chrome/browser/net/chrome_net_log.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "content/public/browser/download_manager.h"
@@ -37,7 +38,8 @@ DownloadManager* DownloadService::GetDownloadManager() {
// SetDownloadManagerDelegateForTesting.
if (!manager_delegate_.get())
manager_delegate_ = new ChromeDownloadManagerDelegate(profile_);
- manager_ = DownloadManager::Create(manager_delegate_.get());
+ manager_ = DownloadManager::Create(manager_delegate_.get(),
+ g_browser_process->net_log());
manager_->Init(profile_);
manager_delegate_->SetDownloadManager(manager_);