Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: content/browser/loader/resource_dispatcher_host_impl.cc

Issue 1999943002: Moving HTTP POST body from StartNavigationParams to CommonNavigationParams. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed CR feedback from clamy@. Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 ResourceRequestBody* body = info.common_params.post_data.get();
2256 AttachRequestBodyBlobDataHandles( 2256 if (body) {
2257 info.request_body.get(), 2257 AttachRequestBodyBlobDataHandles(body, blob_context);
2258 blob_context);
2259 // TODO(davidben): The FileSystemContext is null here. In the case where 2258 // TODO(davidben): The FileSystemContext is null here. In the case where
2260 // another renderer requested this navigation, this should be the same 2259 // another renderer requested this navigation, this should be the same
2261 // FileSystemContext passed into ShouldServiceRequest. 2260 // FileSystemContext passed into ShouldServiceRequest.
2262 new_request->set_upload(UploadDataStreamBuilder::Build( 2261 new_request->set_upload(UploadDataStreamBuilder::Build(
2263 info.request_body.get(), 2262 body,
2264 blob_context, 2263 blob_context,
2265 nullptr, // file_system_context 2264 nullptr, // file_system_context
2266 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE) 2265 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE)
2267 .get())); 2266 .get()));
2268 } 2267 }
2269 2268
2270 request_id_--; 2269 request_id_--;
2271 2270
2272 // Make extra info and read footer (contains request ID). 2271 // Make extra info and read footer (contains request ID).
2273 // 2272 //
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
2318 new_request.get(), 2317 new_request.get(),
2319 blob_context->GetBlobDataFromPublicURL(new_request->url())); 2318 blob_context->GetBlobDataFromPublicURL(new_request->url()));
2320 } 2319 }
2321 2320
2322 RequestContextFrameType frame_type = 2321 RequestContextFrameType frame_type =
2323 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL 2322 info.is_main_frame ? REQUEST_CONTEXT_FRAME_TYPE_TOP_LEVEL
2324 : REQUEST_CONTEXT_FRAME_TYPE_NESTED; 2323 : REQUEST_CONTEXT_FRAME_TYPE_NESTED;
2325 ServiceWorkerRequestHandler::InitializeForNavigation( 2324 ServiceWorkerRequestHandler::InitializeForNavigation(
2326 new_request.get(), service_worker_handle_core, blob_context, 2325 new_request.get(), service_worker_handle_core, blob_context,
2327 info.begin_params.skip_service_worker, resource_type, 2326 info.begin_params.skip_service_worker, resource_type,
2328 info.begin_params.request_context_type, frame_type, info.request_body); 2327 info.begin_params.request_context_type, frame_type,
2328 info.common_params.post_data);
2329 2329
2330 // TODO(davidben): Attach AppCacheInterceptor. 2330 // TODO(davidben): Attach AppCacheInterceptor.
2331 2331
2332 std::unique_ptr<ResourceHandler> handler( 2332 std::unique_ptr<ResourceHandler> handler(
2333 new NavigationResourceHandler(new_request.get(), loader, delegate())); 2333 new NavigationResourceHandler(new_request.get(), loader, delegate()));
2334 2334
2335 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the 2335 // TODO(davidben): Pass in the appropriate appcache_service. Also fix the
2336 // dependency on child_id/route_id. Those are used by the ResourceScheduler; 2336 // dependency on child_id/route_id. Those are used by the ResourceScheduler;
2337 // currently it's a no-op. 2337 // currently it's a no-op.
2338 handler = 2338 handler =
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after
2689 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); 2689 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id);
2690 response->head.security_info = SerializeSecurityInfo(ssl); 2690 response->head.security_info = SerializeSecurityInfo(ssl);
2691 } 2691 }
2692 2692
2693 CertStore* ResourceDispatcherHostImpl::GetCertStore() { 2693 CertStore* ResourceDispatcherHostImpl::GetCertStore() {
2694 return cert_store_for_testing_ ? cert_store_for_testing_ 2694 return cert_store_for_testing_ ? cert_store_for_testing_
2695 : CertStore::GetInstance(); 2695 : CertStore::GetInstance();
2696 } 2696 }
2697 2697
2698 } // namespace content 2698 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698