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 } | 91 } |
92 | 92 |
93 // Send the download creation information to the download thread. | 93 // Send the download creation information to the download thread. |
94 bool DownloadResourceHandler::OnResponseStarted( | 94 bool DownloadResourceHandler::OnResponseStarted( |
95 int request_id, | 95 int request_id, |
96 content::ResourceResponse* response) { | 96 content::ResourceResponse* response) { |
97 VLOG(20) << __FUNCTION__ << "()" << DebugString() | 97 VLOG(20) << __FUNCTION__ << "()" << DebugString() |
98 << " request_id = " << request_id; | 98 << " request_id = " << request_id; |
99 download_start_time_ = base::TimeTicks::Now(); | 99 download_start_time_ = base::TimeTicks::Now(); |
100 | 100 |
101 if (request_->url().scheme() == "file" || | 101 if (request_->url().scheme() == "data") { |
102 request_->url().scheme() == "data") { | |
103 CallStartedCB(download_id_, net::ERR_DISALLOWED_URL_SCHEME); | 102 CallStartedCB(download_id_, net::ERR_DISALLOWED_URL_SCHEME); |
104 return false; | 103 return false; |
105 } | 104 } |
106 | 105 |
107 // If it's a download, we don't want to poison the cache with it. | 106 // If it's a download, we don't want to poison the cache with it. |
108 request_->StopCaching(); | 107 request_->StopCaching(); |
109 | 108 |
110 std::string content_disposition; | 109 std::string content_disposition; |
111 request_->GetResponseHeaderByName("content-disposition", | 110 request_->GetResponseHeaderByName("content-disposition", |
112 &content_disposition); | 111 &content_disposition); |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 " }", | 434 " }", |
436 request_ ? | 435 request_ ? |
437 request_->url().spec().c_str() : | 436 request_->url().spec().c_str() : |
438 "<NULL request>", | 437 "<NULL request>", |
439 download_id_.local(), | 438 download_id_.local(), |
440 global_id_.child_id, | 439 global_id_.child_id, |
441 global_id_.request_id, | 440 global_id_.request_id, |
442 render_view_id_, | 441 render_view_id_, |
443 save_info_.file_path.value().c_str()); | 442 save_info_.file_path.value().c_str()); |
444 } | 443 } |
OLD | NEW |