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 <stddef.h> | 9 #include <stddef.h> |
10 | 10 |
(...skipping 2131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2142 | 2142 |
2143 void ResourceDispatcherHostImpl::FinishedWithResourcesForRequest( | 2143 void ResourceDispatcherHostImpl::FinishedWithResourcesForRequest( |
2144 net::URLRequest* request) { | 2144 net::URLRequest* request) { |
2145 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); | 2145 ResourceRequestInfoImpl* info = ResourceRequestInfoImpl::ForRequest(request); |
2146 IncrementOutstandingRequestsCount(-1, info); | 2146 IncrementOutstandingRequestsCount(-1, info); |
2147 } | 2147 } |
2148 | 2148 |
2149 void ResourceDispatcherHostImpl::BeginNavigationRequest( | 2149 void ResourceDispatcherHostImpl::BeginNavigationRequest( |
2150 ResourceContext* resource_context, | 2150 ResourceContext* resource_context, |
2151 const NavigationRequestInfo& info, | 2151 const NavigationRequestInfo& info, |
2152 NavigationURLLoaderImplCore* loader, | 2152 NavigationURLLoaderImplCore* loader) { |
2153 ServiceWorkerNavigationHandleCore* service_worker_handle_core) { | |
2154 // PlzNavigate: BeginNavigationRequest currently should only be used for the | 2153 // PlzNavigate: BeginNavigationRequest currently should only be used for the |
2155 // browser-side navigations project. | 2154 // browser-side navigations project. |
2156 CHECK(IsBrowserSideNavigationEnabled()); | 2155 CHECK(IsBrowserSideNavigationEnabled()); |
2157 | 2156 |
2158 ResourceType resource_type = info.is_main_frame ? | 2157 ResourceType resource_type = info.is_main_frame ? |
2159 RESOURCE_TYPE_MAIN_FRAME : RESOURCE_TYPE_SUB_FRAME; | 2158 RESOURCE_TYPE_MAIN_FRAME : RESOURCE_TYPE_SUB_FRAME; |
2160 | 2159 |
2161 if (is_shutdown_ || | 2160 if (is_shutdown_ || |
2162 // TODO(davidben): Check ShouldServiceRequest here. This is important; it | 2161 // TODO(davidben): Check ShouldServiceRequest here. This is important; it |
2163 // needs to be checked relative to the child that /requested/ the | 2162 // needs to be checked relative to the child that /requested/ the |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2271 extra_info->AssociateWithRequest(new_request.get()); | 2270 extra_info->AssociateWithRequest(new_request.get()); |
2272 | 2271 |
2273 if (new_request->url().SchemeIs(url::kBlobScheme)) { | 2272 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
2274 // Hang on to a reference to ensure the blob is not released prior | 2273 // Hang on to a reference to ensure the blob is not released prior |
2275 // to the job being started. | 2274 // to the job being started. |
2276 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 2275 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
2277 new_request.get(), | 2276 new_request.get(), |
2278 blob_context->GetBlobDataFromPublicURL(new_request->url())); | 2277 blob_context->GetBlobDataFromPublicURL(new_request->url())); |
2279 } | 2278 } |
2280 | 2279 |
2281 RequestContextFrameType frame_type = | |
2282 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL | |
2283 : REQUEST_CONTEXT_FRAME_TYPE_NESTED; | |
2284 ServiceWorkerRequestHandler::InitializeForNavigation( | |
2285 new_request.get(), service_worker_handle_core, blob_context, | |
2286 info.begin_params.skip_service_worker, resource_type, | |
2287 info.begin_params.request_context_type, frame_type, | |
2288 info.common_params.post_data); | |
2289 | |
2290 // TODO(davidben): Attach AppCacheInterceptor. | 2280 // TODO(davidben): Attach AppCacheInterceptor. |
2291 | 2281 |
2292 std::unique_ptr<ResourceHandler> handler( | 2282 std::unique_ptr<ResourceHandler> handler( |
2293 new NavigationResourceHandler(new_request.get(), loader, delegate())); | 2283 new NavigationResourceHandler(new_request.get(), loader, delegate())); |
2294 | 2284 |
2295 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the | 2285 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the |
2296 // dependency on child_id/route_id. Those are used by the ResourceScheduler; | 2286 // dependency on child_id/route_id. Those are used by the ResourceScheduler; |
2297 // currently it's a no-op. | 2287 // currently it's a no-op. |
2298 handler = | 2288 handler = |
2299 AddStandardHandlers(new_request.get(), resource_type, resource_context, | 2289 AddStandardHandlers(new_request.get(), resource_type, resource_context, |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2649 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); | 2639 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
2650 response->head.security_info = SerializeSecurityInfo(ssl); | 2640 response->head.security_info = SerializeSecurityInfo(ssl); |
2651 } | 2641 } |
2652 | 2642 |
2653 CertStore* ResourceDispatcherHostImpl::GetCertStore() { | 2643 CertStore* ResourceDispatcherHostImpl::GetCertStore() { |
2654 return cert_store_for_testing_ ? cert_store_for_testing_ | 2644 return cert_store_for_testing_ ? cert_store_for_testing_ |
2655 : CertStore::GetInstance(); | 2645 : CertStore::GetInstance(); |
2656 } | 2646 } |
2657 | 2647 |
2658 } // namespace content | 2648 } // namespace content |
OLD | NEW |