OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading | 5 // See http://dev.chromium.org/developers/design-documents/multi-process-resourc e-loading |
6 | 6 |
7 #include "content/browser/renderer_host/resource_dispatcher_host.h" | 7 #include "content/browser/renderer_host/resource_dispatcher_host.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 route_id, | 488 route_id, |
489 this); | 489 this); |
490 } | 490 } |
491 | 491 |
492 // Insert a buffered event handler before the actual one. | 492 // Insert a buffered event handler before the actual one. |
493 handler = new BufferedResourceHandler(handler, this, request); | 493 handler = new BufferedResourceHandler(handler, this, request); |
494 | 494 |
495 if (delegate_) { | 495 if (delegate_) { |
496 bool sub = request_data.resource_type != ResourceType::MAIN_FRAME; | 496 bool sub = request_data.resource_type != ResourceType::MAIN_FRAME; |
497 handler = delegate_->RequestBeginning( | 497 handler = delegate_->RequestBeginning( |
498 handler, request, sub, child_id, route_id); | 498 handler, request, filter_->resource_context(), sub, child_id, |
499 route_id); | |
499 } | 500 } |
500 | 501 |
501 // Make extra info and read footer (contains request ID). | 502 // Make extra info and read footer (contains request ID). |
502 ResourceDispatcherHostRequestInfo* extra_info = | 503 ResourceDispatcherHostRequestInfo* extra_info = |
503 new ResourceDispatcherHostRequestInfo( | 504 new ResourceDispatcherHostRequestInfo( |
504 handler, | 505 handler, |
505 process_type, | 506 process_type, |
506 child_id, | 507 child_id, |
507 route_id, | 508 route_id, |
508 request_data.origin_pid, | 509 request_data.origin_pid, |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
704 new DownloadResourceHandler(this, | 705 new DownloadResourceHandler(this, |
705 child_id, | 706 child_id, |
706 route_id, | 707 route_id, |
707 request_id_, | 708 request_id_, |
708 url, | 709 url, |
709 download_file_manager_.get(), | 710 download_file_manager_.get(), |
710 request, | 711 request, |
711 prompt_for_save_location, | 712 prompt_for_save_location, |
712 save_info)); | 713 save_info)); |
713 | 714 |
714 if (delegate_) | 715 if (delegate_ && context.safe_browsing_enabled()) |
Joao da Silva
2011/06/22 13:38:03
Isn't the check performed at the delegate too? It
Miranda Callahan
2011/06/22 16:25:18
Done.
| |
715 handler = delegate_->DownloadStarting(handler, child_id, route_id); | 716 handler = delegate_->DownloadStarting(handler, filter_->resource_context(), |
717 child_id, route_id); | |
716 | 718 |
717 const net::URLRequestContext* request_context = context.request_context(); | 719 const net::URLRequestContext* request_context = context.request_context(); |
718 | 720 |
719 if (!request_context->job_factory()->IsHandledURL(url)) { | 721 if (!request_context->job_factory()->IsHandledURL(url)) { |
720 VLOG(1) << "Download request for unsupported protocol: " | 722 VLOG(1) << "Download request for unsupported protocol: " |
721 << url.possibly_invalid_spec(); | 723 << url.possibly_invalid_spec(); |
722 return; | 724 return; |
723 } | 725 } |
724 | 726 |
725 request->set_method("GET"); | 727 request->set_method("GET"); |
(...skipping 1279 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2005 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; | 2007 return HTTP_AUTH_RESOURCE_BLOCKED_CROSS; |
2006 } | 2008 } |
2007 | 2009 |
2008 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { | 2010 bool ResourceDispatcherHost::allow_cross_origin_auth_prompt() { |
2009 return allow_cross_origin_auth_prompt_; | 2011 return allow_cross_origin_auth_prompt_; |
2010 } | 2012 } |
2011 | 2013 |
2012 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { | 2014 void ResourceDispatcherHost::set_allow_cross_origin_auth_prompt(bool value) { |
2013 allow_cross_origin_auth_prompt_ = value; | 2015 allow_cross_origin_auth_prompt_ = value; |
2014 } | 2016 } |
OLD | NEW |