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 // 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/loader/resource_dispatcher_host_impl.h" | 7 #include "content/browser/loader/resource_dispatcher_host_impl.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 700 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
711 is_content_initiated, must_download, &throttles); | 711 is_content_initiated, must_download, &throttles); |
712 if (!throttles.empty()) { | 712 if (!throttles.empty()) { |
713 handler.reset( | 713 handler.reset( |
714 new ThrottlingResourceHandler( | 714 new ThrottlingResourceHandler( |
715 handler.Pass(), request, throttles.Pass())); | 715 handler.Pass(), request, throttles.Pass())); |
716 } | 716 } |
717 } | 717 } |
718 return handler.Pass(); | 718 return handler.Pass(); |
719 } | 719 } |
720 | 720 |
721 scoped_ptr<ResourceHandler> | 721 scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::MaybeInterceptAsStream( |
722 ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request, | 722 const base::FilePath& plugin_path, |
723 ResourceResponse* response, | 723 net::URLRequest* request, |
724 std::string* payload) { | 724 ResourceResponse* response, |
| 725 std::string* payload) { |
| 726 payload->clear(); |
725 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); | 727 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); |
726 const std::string& mime_type = response->head.mime_type; | 728 const std::string& mime_type = response->head.mime_type; |
727 | 729 |
728 GURL origin; | 730 GURL origin; |
729 if (!delegate_ || | 731 if (!delegate_ || |
730 !delegate_->ShouldInterceptResourceAsStream(request, | 732 !delegate_->ShouldInterceptResourceAsStream( |
731 mime_type, | 733 request, plugin_path, mime_type, &origin, payload)) { |
732 &origin, | |
733 payload)) { | |
734 return scoped_ptr<ResourceHandler>(); | 734 return scoped_ptr<ResourceHandler>(); |
735 } | 735 } |
736 | 736 |
737 StreamContext* stream_context = | 737 StreamContext* stream_context = |
738 GetStreamContextForResourceContext(info->GetContext()); | 738 GetStreamContextForResourceContext(info->GetContext()); |
739 | 739 |
740 scoped_ptr<StreamResourceHandler> handler( | 740 scoped_ptr<StreamResourceHandler> handler( |
741 new StreamResourceHandler(request, | 741 new StreamResourceHandler(request, |
742 stream_context->registry(), | 742 stream_context->registry(), |
743 origin)); | 743 origin)); |
(...skipping 1608 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) | 2352 if ((load_flags & net::LOAD_REPORT_RAW_HEADERS) |
2353 && !policy->CanReadRawCookies(child_id)) { | 2353 && !policy->CanReadRawCookies(child_id)) { |
2354 VLOG(1) << "Denied unauthorized request for raw headers"; | 2354 VLOG(1) << "Denied unauthorized request for raw headers"; |
2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; | 2355 load_flags &= ~net::LOAD_REPORT_RAW_HEADERS; |
2356 } | 2356 } |
2357 | 2357 |
2358 return load_flags; | 2358 return load_flags; |
2359 } | 2359 } |
2360 | 2360 |
2361 } // namespace content | 2361 } // namespace content |
OLD | NEW |