DescriptionHooked 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.
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=121050
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=121195
Patch Set 1 #Patch Set 2 : Merged with trunk #Patch Set 3 : Merged with parent #Patch Set 4 : Merged with parent #Patch Set 5 : Fixed event type name for Download to refer to URL Request #
Total comments: 11
Patch Set 6 : Merged with parent #
Total comments: 7
Patch Set 7 : Not sure if anything changed . . . #Patch Set 8 : Addressed Randy's comments. #
Total comments: 4
Patch Set 9 : Merged with parent, plus move the BoundNetLog construction. #Patch Set 10 : Merged with parent #
Total comments: 2
Patch Set 11 : Merged with parent #Patch Set 12 : Create DownloadItem's BoundNetLog closer to constructor #
Total comments: 10
Patch Set 13 : Renamed a variable & changed comments #
Total comments: 2
Patch Set 14 : Merged with trunk #Messages
Total messages: 25 (0 generated)
|