| 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 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 133 | 133 |
| 134 if (!response->headers || | 134 if (!response->headers || |
| 135 !response->headers->EnumerateHeader(NULL, | 135 !response->headers->EnumerateHeader(NULL, |
| 136 "Accept-Ranges", | 136 "Accept-Ranges", |
| 137 &accept_ranges_)) { | 137 &accept_ranges_)) { |
| 138 accept_ranges_ = ""; | 138 accept_ranges_ = ""; |
| 139 } | 139 } |
| 140 | 140 |
| 141 info->prompt_user_for_save_location = | 141 info->prompt_user_for_save_location = |
| 142 save_info_.prompt_for_save_location && save_info_.file_path.empty(); | 142 save_info_.prompt_for_save_location && save_info_.file_path.empty(); |
| 143 info->referrer_charset = request_->context()->referrer_charset(); | 143 info->default_charset = request_->context()->default_charset(); |
| 144 info->save_info = save_info_; | 144 info->save_info = save_info_; |
| 145 | 145 |
| 146 | 146 |
| 147 BrowserThread::PostTask( | 147 BrowserThread::PostTask( |
| 148 BrowserThread::UI, FROM_HERE, | 148 BrowserThread::UI, FROM_HERE, |
| 149 base::Bind(&DownloadResourceHandler::StartOnUIThread, this, | 149 base::Bind(&DownloadResourceHandler::StartOnUIThread, this, |
| 150 base::Passed(&info), request_handle)); | 150 base::Passed(&info), request_handle)); |
| 151 | 151 |
| 152 // We can't start saving the data before we create the file on disk and have a | 152 // We can't start saving the data before we create the file on disk and have a |
| 153 // download id. The request will be un-paused in | 153 // download id. The request will be un-paused in |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 " render_view_id_ = " "%d" | 375 " render_view_id_ = " "%d" |
| 376 " save_info_.file_path = \"%" PRFilePath "\"" | 376 " save_info_.file_path = \"%" PRFilePath "\"" |
| 377 " }", | 377 " }", |
| 378 request_->url().spec().c_str(), | 378 request_->url().spec().c_str(), |
| 379 download_id_.local(), | 379 download_id_.local(), |
| 380 global_id_.child_id, | 380 global_id_.child_id, |
| 381 global_id_.request_id, | 381 global_id_.request_id, |
| 382 render_view_id_, | 382 render_view_id_, |
| 383 save_info_.file_path.value().c_str()); | 383 save_info_.file_path.value().c_str()); |
| 384 } | 384 } |
| OLD | NEW |