| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 std::string content_disposition; | 89 std::string content_disposition; |
| 90 request_->GetResponseHeaderByName("content-disposition", | 90 request_->GetResponseHeaderByName("content-disposition", |
| 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( |
| 100 base::Time::Now(), 0, content_length_, DownloadItem::IN_PROGRESS, | 100 base::Time::Now(), 0, content_length_, DownloadItem::IN_PROGRESS, |
| 101 request_->net_log(), request_info->has_user_gesture(), | 101 request_->net_log(), request_info->has_user_gesture(), |
| 102 request_info->transition_type())); | 102 request_info->transition_type())); |
| 103 info->url_chain = request_->url_chain(); | 103 info->url_chain = request_->url_chain(); |
| 104 info->referrer_url = GURL(request_->referrer()); | 104 info->referrer_url = GURL(request_->referrer()); |
| 105 info->start_time = base::Time::Now(); | 105 info->start_time = base::Time::Now(); |
| 106 info->received_bytes = save_info_.offset; | 106 info->received_bytes = save_info_.offset; |
| 107 info->total_bytes = content_length_; | 107 info->total_bytes = content_length_; |
| 108 info->state = DownloadItem::IN_PROGRESS; | 108 info->state = DownloadItem::IN_PROGRESS; |
| 109 info->has_user_gesture = request_info->has_user_gesture(); | 109 info->has_user_gesture = request_info->has_user_gesture(); |
| (...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 " render_view_id_ = " "%d" | 379 " render_view_id_ = " "%d" |
| 380 " save_info_.file_path = \"%" PRFilePath "\"" | 380 " save_info_.file_path = \"%" PRFilePath "\"" |
| 381 " }", | 381 " }", |
| 382 request_->url().spec().c_str(), | 382 request_->url().spec().c_str(), |
| 383 download_id_.local(), | 383 download_id_.local(), |
| 384 global_id_.child_id, | 384 global_id_.child_id, |
| 385 global_id_.request_id, | 385 global_id_.request_id, |
| 386 render_view_id_, | 386 render_view_id_, |
| 387 save_info_.file_path.value().c_str()); | 387 save_info_.file_path.value().c_str()); |
| 388 } | 388 } |
| OLD | NEW |