Chromium Code Reviews| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "content/browser/download/save_file_manager.h" | 7 #include "content/browser/download/save_file_manager.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 292 const Referrer& referrer, | 292 const Referrer& referrer, |
| 293 SaveItemId save_item_id, | 293 SaveItemId save_item_id, |
| 294 SavePackageId save_package_id, | 294 SavePackageId save_package_id, |
| 295 int render_process_host_id, | 295 int render_process_host_id, |
| 296 int render_view_routing_id, | 296 int render_view_routing_id, |
| 297 int render_frame_routing_id, | 297 int render_frame_routing_id, |
| 298 ResourceContext* context) { | 298 ResourceContext* context) { |
| 299 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 299 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
| 300 | 300 |
| 301 const net::URLRequestContext* request_context = context->GetRequestContext(); | 301 const net::URLRequestContext* request_context = context->GetRequestContext(); |
| 302 if (!request_context->job_factory()->IsHandledURL(url)) { | 302 if (!request_context->job_factory()->IsHandledProtocol(url.scheme())) { |
|
mmenke
2017/03/31 04:30:04
There's a DCHECK about URL validity before calling
asanka
2017/03/31 20:38:30
Acknowledged.
| |
| 303 // Since any URLs which have non-standard scheme have been filtered | 303 // Since any URLs which have non-standard scheme have been filtered |
| 304 // by save manager(see GURL::SchemeIsStandard). This situation | 304 // by save manager(see GURL::SchemeIsStandard). This situation |
| 305 // should not happen. | 305 // should not happen. |
| 306 NOTREACHED(); | 306 NOTREACHED(); |
| 307 return; | 307 return; |
| 308 } | 308 } |
| 309 | 309 |
| 310 std::unique_ptr<net::URLRequest> request( | 310 std::unique_ptr<net::URLRequest> request( |
| 311 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, NULL)); | 311 request_context->CreateRequest(url, net::DEFAULT_PRIORITY, NULL)); |
| 312 request->set_method("GET"); | 312 request->set_method("GET"); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 448 if (it != save_file_map_.end()) { | 448 if (it != save_file_map_.end()) { |
| 449 SaveFile* save_file = it->second.get(); | 449 SaveFile* save_file = it->second.get(); |
| 450 DCHECK(!save_file->InProgress()); | 450 DCHECK(!save_file->InProgress()); |
| 451 base::DeleteFile(save_file->FullPath(), false); | 451 base::DeleteFile(save_file->FullPath(), false); |
| 452 save_file_map_.erase(it); | 452 save_file_map_.erase(it); |
| 453 } | 453 } |
| 454 } | 454 } |
| 455 } | 455 } |
| 456 | 456 |
| 457 } // namespace content | 457 } // namespace content |
| OLD | NEW |