diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 22:14:33 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-08 22:14:33 +0000 |
commit | d12f1471a7d9a5d82de92990cf82e21957fdc3ff (patch) | |
tree | 65fc519ee8871a4b3c06371576bb9c142ba83b68 /content/browser/download/drag_download_util.h | |
parent | 7b054893fdead91168156d7462482f3a16241c65 (diff) | |
download | chromium_src-d12f1471a7d9a5d82de92990cf82e21957fdc3ff.zip chromium_src-d12f1471a7d9a5d82de92990cf82e21957fdc3ff.tar.gz chromium_src-d12f1471a7d9a5d82de92990cf82e21957fdc3ff.tar.bz2 |
Back out r121050 from the trunk due to a compile failure.
http://build.chromium.org/p/chromium/builders/Win%20Aura/builds/5477/steps/compile/logs/stdio
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
TBR=ahendrickson@chromium.org
Review URL: https://chromiumcodereview.appspot.com/9361048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@121073 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/download/drag_download_util.h')
-rw-r--r-- | content/browser/download/drag_download_util.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/content/browser/download/drag_download_util.h b/content/browser/download/drag_download_util.h index 7cb7ada..95a5521 100644 --- a/content/browser/download/drag_download_util.h +++ b/content/browser/download/drag_download_util.h @@ -1,4 +1,4 @@ -// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -38,9 +38,7 @@ CONTENT_EXPORT bool ParseDownloadMetadata(const string16& metadata, // Create a new file at the specified path. If the file already exists, try to // insert the sequential unifier to produce a new file, like foo-01.txt. // Return a FileStream if successful. -// |net_log| is a NetLog for the stream. -CONTENT_EXPORT net::FileStream* CreateFileStreamForDrop( - FilePath* file_path, net::NetLog* net_log); +CONTENT_EXPORT net::FileStream* CreateFileStreamForDrop(FilePath* file_path); // Implementation of DownloadFileObserver to finalize the download process. class CONTENT_EXPORT PromiseFileFinalizer : public ui::DownloadFileObserver { |