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..c33b4e1bbce959b78c67ebcee2af9b11e288b3fe 100644 |
--- a/content/browser/download/download_resource_handler.cc |
+++ b/content/browser/download/download_resource_handler.cc |
@@ -40,6 +40,7 @@ DownloadResourceHandler::DownloadResourceHandler( |
int render_view_id, |
int request_id, |
const GURL& url, |
+ const net::BoundNetLog& bound_net_log, |
DownloadFileManager* download_file_manager, |
net::URLRequest* request, |
const DownloadResourceHandler::OnStartedCallback& started_cb, |
@@ -56,8 +57,21 @@ DownloadResourceHandler::DownloadResourceHandler( |
rdh_(rdh), |
is_paused_(false), |
last_buffer_size_(0), |
- bytes_read_(0) { |
+ bytes_read_(0), |
+ bound_net_log_(bound_net_log) { |
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(); |