OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "content/browser/download/download_resource_handler.h" | 5 #include "content/browser/download/download_resource_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 info->url_chain = request_->url_chain(); | 104 info->url_chain = request_->url_chain(); |
105 info->referrer_url = GURL(request_->referrer()); | 105 info->referrer_url = GURL(request_->referrer()); |
106 info->start_time = base::Time::Now(); | 106 info->start_time = base::Time::Now(); |
107 info->received_bytes = 0; | 107 info->received_bytes = 0; |
108 info->total_bytes = content_length_; | 108 info->total_bytes = content_length_; |
109 info->state = DownloadItem::IN_PROGRESS; | 109 info->state = DownloadItem::IN_PROGRESS; |
110 info->download_id = download_id_; | 110 info->download_id = download_id_; |
111 info->has_user_gesture = request_info->has_user_gesture(); | 111 info->has_user_gesture = request_info->has_user_gesture(); |
112 info->content_disposition = content_disposition_; | 112 info->content_disposition = content_disposition_; |
113 info->mime_type = response->mime_type; | 113 info->mime_type = response->mime_type; |
| 114 info->remote_address = request_->GetSocketAddress().host(); |
114 download_stats::RecordDownloadMimeType(info->mime_type); | 115 download_stats::RecordDownloadMimeType(info->mime_type); |
115 | 116 |
116 DownloadRequestHandle request_handle(rdh_, global_id_.child_id, | 117 DownloadRequestHandle request_handle(rdh_, global_id_.child_id, |
117 render_view_id_, global_id_.request_id); | 118 render_view_id_, global_id_.request_id); |
118 | 119 |
119 // TODO(ahendrickson) -- Get the last modified time and etag, so we can | 120 // TODO(ahendrickson) -- Get the last modified time and etag, so we can |
120 // resume downloading. | 121 // resume downloading. |
121 | 122 |
122 CallStartedCB(net::OK); | 123 CallStartedCB(net::OK); |
123 | 124 |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 " render_view_id_ = " "%d" | 324 " render_view_id_ = " "%d" |
324 " save_info_.file_path = \"%" PRFilePath "\"" | 325 " save_info_.file_path = \"%" PRFilePath "\"" |
325 " }", | 326 " }", |
326 request_->url().spec().c_str(), | 327 request_->url().spec().c_str(), |
327 download_id_.local(), | 328 download_id_.local(), |
328 global_id_.child_id, | 329 global_id_.child_id, |
329 global_id_.request_id, | 330 global_id_.request_id, |
330 render_view_id_, | 331 render_view_id_, |
331 save_info_.file_path.value().c_str()); | 332 save_info_.file_path.value().c_str()); |
332 } | 333 } |
OLD | NEW |