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(); |