OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 &content_disposition); | 91 &content_disposition); |
92 set_content_disposition(content_disposition); | 92 set_content_disposition(content_disposition); |
93 set_content_length(response->content_length); | 93 set_content_length(response->content_length); |
94 | 94 |
95 const ResourceDispatcherHostRequestInfo* request_info = | 95 const ResourceDispatcherHostRequestInfo* request_info = |
96 ResourceDispatcherHost::InfoForRequest(request_); | 96 ResourceDispatcherHost::InfoForRequest(request_); |
97 | 97 |
98 // Deleted in DownloadManager. | 98 // Deleted in DownloadManager. |
99 scoped_ptr<DownloadCreateInfo> info(new DownloadCreateInfo(FilePath(), GURL(), | 99 scoped_ptr<DownloadCreateInfo> info(new DownloadCreateInfo(FilePath(), GURL(), |
100 base::Time::Now(), 0, content_length_, DownloadItem::IN_PROGRESS, | 100 base::Time::Now(), 0, content_length_, DownloadItem::IN_PROGRESS, |
101 request_info->has_user_gesture(), request_info->transition_type())); | 101 request_->net_log(), request_info->has_user_gesture(), |
| 102 request_info->transition_type())); |
102 info->url_chain = request_->url_chain(); | 103 info->url_chain = request_->url_chain(); |
103 info->referrer_url = GURL(request_->referrer()); | 104 info->referrer_url = GURL(request_->referrer()); |
104 info->start_time = base::Time::Now(); | 105 info->start_time = base::Time::Now(); |
105 info->received_bytes = save_info_.offset; | 106 info->received_bytes = save_info_.offset; |
106 info->total_bytes = content_length_; | 107 info->total_bytes = content_length_; |
107 info->state = DownloadItem::IN_PROGRESS; | 108 info->state = DownloadItem::IN_PROGRESS; |
108 info->has_user_gesture = request_info->has_user_gesture(); | 109 info->has_user_gesture = request_info->has_user_gesture(); |
109 info->content_disposition = content_disposition_; | 110 info->content_disposition = content_disposition_; |
110 info->mime_type = response->mime_type; | 111 info->mime_type = response->mime_type; |
111 info->remote_address = request_->GetSocketAddress().host(); | 112 info->remote_address = request_->GetSocketAddress().host(); |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 " render_view_id_ = " "%d" | 376 " render_view_id_ = " "%d" |
376 " save_info_.file_path = \"%" PRFilePath "\"" | 377 " save_info_.file_path = \"%" PRFilePath "\"" |
377 " }", | 378 " }", |
378 request_->url().spec().c_str(), | 379 request_->url().spec().c_str(), |
379 download_id_.local(), | 380 download_id_.local(), |
380 global_id_.child_id, | 381 global_id_.child_id, |
381 global_id_.request_id, | 382 global_id_.request_id, |
382 render_view_id_, | 383 render_view_id_, |
383 save_info_.file_path.value().c_str()); | 384 save_info_.file_path.value().c_str()); |
384 } | 385 } |
OLD | NEW |