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

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

Issue 1956383003: Forwarding POST body into renderer after a cross-site transfer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Extracted a shared NavigationEntryImpl::ConstructResourceRequestBody. 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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after
1573 false, // is download 1573 false, // is download
1574 false, // is stream 1574 false, // is stream
1575 allow_download, request_data.has_user_gesture, 1575 allow_download, request_data.has_user_gesture,
1576 request_data.enable_load_timing, request_data.enable_upload_progress, 1576 request_data.enable_load_timing, request_data.enable_upload_progress,
1577 do_not_prompt_for_login, request_data.referrer_policy, 1577 do_not_prompt_for_login, request_data.referrer_policy,
1578 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(), 1578 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(),
1579 report_raw_headers, !is_sync_load, 1579 report_raw_headers, !is_sync_load,
1580 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request, 1580 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request,
1581 resource_context, 1581 resource_context,
1582 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME), 1582 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME),
1583 support_async_revalidation ? request_data.headers : std::string()); 1583 support_async_revalidation ? request_data.headers : std::string(),
1584 request_data.request_body);
1584 // Request takes ownership. 1585 // Request takes ownership.
1585 extra_info->AssociateWithRequest(new_request.get()); 1586 extra_info->AssociateWithRequest(new_request.get());
1586 1587
1587 if (new_request->url().SchemeIs(url::kBlobScheme)) { 1588 if (new_request->url().SchemeIs(url::kBlobScheme)) {
1588 // Hang on to a reference to ensure the blob is not released prior 1589 // Hang on to a reference to ensure the blob is not released prior
1589 // to the job being started. 1590 // to the job being started.
1590 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1591 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1591 new_request.get(), 1592 new_request.get(),
1592 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( 1593 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL(
1593 new_request->url())); 1594 new_request->url()));
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
1851 bool download, 1852 bool download,
1852 ResourceContext* context) { 1853 ResourceContext* context) {
1853 return new ResourceRequestInfoImpl( 1854 return new ResourceRequestInfoImpl(
1854 PROCESS_TYPE_RENDERER, 1855 PROCESS_TYPE_RENDERER,
1855 child_id, 1856 child_id,
1856 render_view_route_id, 1857 render_view_route_id,
1857 -1, // frame_tree_node_id 1858 -1, // frame_tree_node_id
1858 0, 1859 0,
1859 request_id_, 1860 request_id_,
1860 render_frame_route_id, 1861 render_frame_route_id,
1861 false, // is_main_frame 1862 false, // is_main_frame
1862 false, // parent_is_main_frame 1863 false, // parent_is_main_frame
1863 RESOURCE_TYPE_SUB_RESOURCE, 1864 RESOURCE_TYPE_SUB_RESOURCE,
1864 ui::PAGE_TRANSITION_LINK, 1865 ui::PAGE_TRANSITION_LINK,
1865 false, // should_replace_current_entry 1866 false, // should_replace_current_entry
1866 download, // is_download 1867 download, // is_download
1867 false, // is_stream 1868 false, // is_stream
1868 download, // allow_download 1869 download, // allow_download
1869 false, // has_user_gesture 1870 false, // has_user_gesture
1870 false, // enable_load_timing 1871 false, // enable_load_timing
1871 false, // enable_upload_progress 1872 false, // enable_upload_progress
1872 false, // do_not_prompt_for_login 1873 false, // do_not_prompt_for_login
1873 blink::WebReferrerPolicyDefault, 1874 blink::WebReferrerPolicyDefault,
1874 blink::WebPageVisibilityStateVisible, 1875 blink::WebPageVisibilityStateVisible,
1875 context, 1876 context,
1876 base::WeakPtr<ResourceMessageFilter>(), // filter 1877 base::WeakPtr<ResourceMessageFilter>(), // filter
1877 false, // report_raw_headers 1878 false, // report_raw_headers
1878 true, // is_async 1879 true, // is_async
1879 false, // is_using_lofi 1880 false, // is_using_lofi
1880 std::string()); // original_headers 1881 std::string(), // original_headers
1882 nullptr); // body
1881 } 1883 }
1882 1884
1883 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( 1885 void ResourceDispatcherHostImpl::OnRenderFrameDeleted(
1884 const GlobalFrameRoutingId& global_routing_id) { 1886 const GlobalFrameRoutingId& global_routing_id) {
1885 CancelRequestsForRoute(global_routing_id); 1887 CancelRequestsForRoute(global_routing_id);
1886 } 1888 }
1887 1889
1888 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, 1890 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id,
1889 int route_id) { 1891 int route_id) {
1890 scheduler_->OnClientCreated(child_id, route_id); 1892 scheduler_->OnClientCreated(child_id, route_id);
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
2299 base::WeakPtr<ResourceMessageFilter>(), // filter 2301 base::WeakPtr<ResourceMessageFilter>(), // filter
2300 false, // request_data.report_raw_headers 2302 false, // request_data.report_raw_headers
2301 true, // is_async 2303 true, // is_async
2302 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, 2304 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request,
2303 resource_context, info.is_main_frame), 2305 resource_context, info.is_main_frame),
2304 // The original_headers field is for stale-while-revalidate but the 2306 // The original_headers field is for stale-while-revalidate but the
2305 // feature doesn't work with PlzNavigate, so it's just a placeholder 2307 // feature doesn't work with PlzNavigate, so it's just a placeholder
2306 // here. 2308 // here.
2307 // TODO(ricea): Make the feature work with stale-while-revalidate 2309 // TODO(ricea): Make the feature work with stale-while-revalidate
2308 // and clean this up. 2310 // and clean this up.
2309 std::string()); // original_headers 2311 std::string(), // original_headers
2312 info.request_body);
2310 // Request takes ownership. 2313 // Request takes ownership.
2311 extra_info->AssociateWithRequest(new_request.get()); 2314 extra_info->AssociateWithRequest(new_request.get());
2312 2315
2313 if (new_request->url().SchemeIs(url::kBlobScheme)) { 2316 if (new_request->url().SchemeIs(url::kBlobScheme)) {
2314 // Hang on to a reference to ensure the blob is not released prior 2317 // Hang on to a reference to ensure the blob is not released prior
2315 // to the job being started. 2318 // to the job being started.
2316 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 2319 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
2317 new_request.get(), 2320 new_request.get(),
2318 blob_context->GetBlobDataFromPublicURL(new_request->url())); 2321 blob_context->GetBlobDataFromPublicURL(new_request->url()));
2319 } 2322 }
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2688 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); 2691 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id);
2689 response->head.security_info = SerializeSecurityInfo(ssl); 2692 response->head.security_info = SerializeSecurityInfo(ssl);
2690 } 2693 }
2691 2694
2692 CertStore* ResourceDispatcherHostImpl::GetCertStore() { 2695 CertStore* ResourceDispatcherHostImpl::GetCertStore() {
2693 return cert_store_for_testing_ ? cert_store_for_testing_ 2696 return cert_store_for_testing_ ? cert_store_for_testing_
2694 : CertStore::GetInstance(); 2697 : CertStore::GetInstance();
2695 } 2698 }
2696 2699
2697 } // namespace content 2700 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698