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 2234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2245 net::HttpRequestHeaders headers; | 2245 net::HttpRequestHeaders headers; |
2246 headers.AddHeadersFromString(info.begin_params.headers); | 2246 headers.AddHeadersFromString(info.begin_params.headers); |
2247 new_request->SetExtraRequestHeaders(headers); | 2247 new_request->SetExtraRequestHeaders(headers); |
2248 | 2248 |
2249 new_request->SetLoadFlags(load_flags); | 2249 new_request->SetLoadFlags(load_flags); |
2250 | 2250 |
2251 storage::BlobStorageContext* blob_context = GetBlobStorageContext( | 2251 storage::BlobStorageContext* blob_context = GetBlobStorageContext( |
2252 GetChromeBlobStorageContextForResourceContext(resource_context)); | 2252 GetChromeBlobStorageContextForResourceContext(resource_context)); |
2253 | 2253 |
2254 // Resolve elements from request_body and prepare upload data. | 2254 // Resolve elements from request_body and prepare upload data. |
2255 if (info.request_body.get()) { | 2255 if (ResourceRequestBody* body = info.common_params.post_data.get()) { |
clamy
2016/05/23 16:59:28
nit: I think in the codebase we tend to instantiat
Łukasz Anforowicz
2016/05/23 18:38:47
Done.
| |
2256 AttachRequestBodyBlobDataHandles( | 2256 AttachRequestBodyBlobDataHandles(body, blob_context); |
2257 info.request_body.get(), | |
2258 blob_context); | |
2259 // TODO(davidben): The FileSystemContext is null here. In the case where | 2257 // TODO(davidben): The FileSystemContext is null here. In the case where |
2260 // another renderer requested this navigation, this should be the same | 2258 // another renderer requested this navigation, this should be the same |
2261 // FileSystemContext passed into ShouldServiceRequest. | 2259 // FileSystemContext passed into ShouldServiceRequest. |
2262 new_request->set_upload(UploadDataStreamBuilder::Build( | 2260 new_request->set_upload(UploadDataStreamBuilder::Build( |
2263 info.request_body.get(), | 2261 body, |
2264 blob_context, | 2262 blob_context, |
2265 nullptr, // file_system_context | 2263 nullptr, // file_system_context |
2266 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) | 2264 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) |
2267 .get())); | 2265 .get())); |
2268 } | 2266 } |
2269 | 2267 |
2270 request_id_--; | 2268 request_id_--; |
2271 | 2269 |
2272 // Make extra info and read footer (contains request ID). | 2270 // Make extra info and read footer (contains request ID). |
2273 // | 2271 // |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2318 new_request.get(), | 2316 new_request.get(), |
2319 blob_context->GetBlobDataFromPublicURL(new_request->url())); | 2317 blob_context->GetBlobDataFromPublicURL(new_request->url())); |
2320 } | 2318 } |
2321 | 2319 |
2322 RequestContextFrameType frame_type = | 2320 RequestContextFrameType frame_type = |
2323 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL | 2321 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL |
2324 : REQUEST_CONTEXT_FRAME_TYPE_NESTED; | 2322 : REQUEST_CONTEXT_FRAME_TYPE_NESTED; |
2325 ServiceWorkerRequestHandler::InitializeForNavigation( | 2323 ServiceWorkerRequestHandler::InitializeForNavigation( |
2326 new_request.get(), service_worker_handle_core, blob_context, | 2324 new_request.get(), service_worker_handle_core, blob_context, |
2327 info.begin_params.skip_service_worker, resource_type, | 2325 info.begin_params.skip_service_worker, resource_type, |
2328 info.begin_params.request_context_type, frame_type, info.request_body); | 2326 info.begin_params.request_context_type, frame_type, |
2327 info.common_params.post_data); | |
2329 | 2328 |
2330 // TODO(davidben): Attach AppCacheInterceptor. | 2329 // TODO(davidben): Attach AppCacheInterceptor. |
2331 | 2330 |
2332 std::unique_ptr<ResourceHandler> handler( | 2331 std::unique_ptr<ResourceHandler> handler( |
2333 new NavigationResourceHandler(new_request.get(), loader, delegate())); | 2332 new NavigationResourceHandler(new_request.get(), loader, delegate())); |
2334 | 2333 |
2335 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the | 2334 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the |
2336 // dependency on child_id/route_id. Those are used by the ResourceScheduler; | 2335 // dependency on child_id/route_id. Those are used by the ResourceScheduler; |
2337 // currently it's a no-op. | 2336 // currently it's a no-op. |
2338 handler = | 2337 handler = |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2689 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); | 2688 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
2690 response->head.security_info = SerializeSecurityInfo(ssl); | 2689 response->head.security_info = SerializeSecurityInfo(ssl); |
2691 } | 2690 } |
2692 | 2691 |
2693 CertStore* ResourceDispatcherHostImpl::GetCertStore() { | 2692 CertStore* ResourceDispatcherHostImpl::GetCertStore() { |
2694 return cert_store_for_testing_ ? cert_store_for_testing_ | 2693 return cert_store_for_testing_ ? cert_store_for_testing_ |
2695 : CertStore::GetInstance(); | 2694 : CertStore::GetInstance(); |
2696 } | 2695 } |
2697 | 2696 |
2698 } // namespace content | 2697 } // namespace content |
OLD | NEW |