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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
720 is_content_initiated, must_download, &throttles); | 720 is_content_initiated, must_download, &throttles); |
721 if (!throttles.empty()) { | 721 if (!throttles.empty()) { |
722 handler.reset( | 722 handler.reset( |
723 new ThrottlingResourceHandler( | 723 new ThrottlingResourceHandler( |
724 handler.Pass(), request, throttles.Pass())); | 724 handler.Pass(), request, throttles.Pass())); |
725 } | 725 } |
726 } | 726 } |
727 return handler.Pass(); | 727 return handler.Pass(); |
728 } | 728 } |
729 | 729 |
730 scoped_ptr<ResourceHandler> | 730 scoped_ptr<ResourceHandler> ResourceDispatcherHostImpl::MaybeInterceptAsStream( |
731 ResourceDispatcherHostImpl::MaybeInterceptAsStream(net::URLRequest* request, | 731 const base::FilePath& file_path, |
raymes
2015/03/12 05:21:03
plugin_path
Deepak
2015/03/12 12:33:18
Done.
| |
732 ResourceResponse* response, | 732 net::URLRequest* request, |
733 std::string* payload) { | 733 ResourceResponse* response, |
734 std::string* payload) { | |
734 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); | 735 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); |
735 const std::string& mime_type = response->head.mime_type; | 736 const std::string& mime_type = response->head.mime_type; |
736 | 737 |
737 GURL origin; | 738 GURL origin; |
738 if (!delegate_ || | 739 if (!delegate_ || |
739 !delegate_->ShouldInterceptResourceAsStream(request, | 740 !delegate_->ShouldInterceptResourceAsStream(file_path, request, mime_type, |
740 mime_type, | 741 &origin, payload)) { |
741 &origin, | |
742 payload)) { | |
743 return scoped_ptr<ResourceHandler>(); | 742 return scoped_ptr<ResourceHandler>(); |
744 } | 743 } |
745 | 744 |
746 StreamContext* stream_context = | 745 StreamContext* stream_context = |
747 GetStreamContextForResourceContext(info->GetContext()); | 746 GetStreamContextForResourceContext(info->GetContext()); |
748 | 747 |
749 scoped_ptr<StreamResourceHandler> handler( | 748 scoped_ptr<StreamResourceHandler> handler( |
750 new StreamResourceHandler(request, | 749 new StreamResourceHandler(request, |
751 stream_context->registry(), | 750 stream_context->registry(), |
752 origin)); | 751 origin)); |
(...skipping 1628 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2381 | 2380 |
2382 // Add a flag to selectively bypass the data reduction proxy if the resource | 2381 // Add a flag to selectively bypass the data reduction proxy if the resource |
2383 // type is not an image. | 2382 // type is not an image. |
2384 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) | 2383 if (request_data.resource_type != RESOURCE_TYPE_IMAGE) |
2385 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; | 2384 load_flags |= net::LOAD_BYPASS_DATA_REDUCTION_PROXY; |
2386 | 2385 |
2387 return load_flags; | 2386 return load_flags; |
2388 } | 2387 } |
2389 | 2388 |
2390 } // namespace content | 2389 } // namespace content |
OLD | NEW |