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

Unified Diff: content/browser/download/download_resource_handler.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 parent 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_resource_handler.cc
diff --git a/content/browser/download/download_resource_handler.cc b/content/browser/download/download_resource_handler.cc
index 8915f2a2ecfc067b4bdd4a136c873bd0e883911e..28fb5fbf5387c082f9659b014035236e2b0a6d96 100644
--- a/content/browser/download/download_resource_handler.cc
+++ b/content/browser/download/download_resource_handler.cc
@@ -56,8 +56,22 @@ DownloadResourceHandler::DownloadResourceHandler(
rdh_(rdh),
is_paused_(false),
last_buffer_size_(0),
- bytes_read_(0) {
+ bytes_read_(0),
+ bound_net_log_(net::BoundNetLog::Make(request->net_log().net_log(),
+ net::NetLog::SOURCE_DOWNLOAD)) {
download_stats::RecordDownloadCount(download_stats::UNTHROTTLED_COUNT);
+
+ bound_net_log_.AddEvent(
+ net::NetLog::TYPE_DOWNLOAD_URL_REQUEST,
+ make_scoped_refptr(new net::NetLogSourceParameter(
+ "source_dependency",
+ request->net_log().source())));
+
+ request->net_log().AddEvent(
+ net::NetLog::TYPE_DOWNLOAD_STARTED,
+ make_scoped_refptr(new net::NetLogSourceParameter(
+ "source_dependency",
+ bound_net_log_.source())));
}
bool DownloadResourceHandler::OnUploadProgress(int request_id,
@@ -98,7 +112,8 @@ bool DownloadResourceHandler::OnResponseStarted(
// Deleted in DownloadManager.
scoped_ptr<DownloadCreateInfo> info(new DownloadCreateInfo(FilePath(), GURL(),
base::Time::Now(), 0, content_length_, DownloadItem::IN_PROGRESS,
- request_info->has_user_gesture(), request_info->transition_type()));
+ bound_net_log_, request_info->has_user_gesture(),
+ request_info->transition_type()));
info->url_chain = request_->url_chain();
info->referrer_url = GURL(request_->referrer());
info->start_time = base::Time::Now();

Powered by Google App Engine
This is Rietveld 408576698