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 1563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1574 false, // is download | 1574 false, // is download |
1575 false, // is stream | 1575 false, // is stream |
1576 allow_download, request_data.has_user_gesture, | 1576 allow_download, request_data.has_user_gesture, |
1577 request_data.enable_load_timing, request_data.enable_upload_progress, | 1577 request_data.enable_load_timing, request_data.enable_upload_progress, |
1578 do_not_prompt_for_login, request_data.referrer_policy, | 1578 do_not_prompt_for_login, request_data.referrer_policy, |
1579 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(), | 1579 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(), |
1580 report_raw_headers, !is_sync_load, | 1580 report_raw_headers, !is_sync_load, |
1581 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request, | 1581 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request, |
1582 resource_context, | 1582 resource_context, |
1583 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME), | 1583 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME), |
1584 support_async_revalidation ? request_data.headers : std::string()); | 1584 support_async_revalidation ? request_data.headers : std::string(), |
| 1585 request_data.request_body); |
1585 // Request takes ownership. | 1586 // Request takes ownership. |
1586 extra_info->AssociateWithRequest(new_request.get()); | 1587 extra_info->AssociateWithRequest(new_request.get()); |
1587 | 1588 |
1588 if (new_request->url().SchemeIs(url::kBlobScheme)) { | 1589 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
1589 // Hang on to a reference to ensure the blob is not released prior | 1590 // Hang on to a reference to ensure the blob is not released prior |
1590 // to the job being started. | 1591 // to the job being started. |
1591 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 1592 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
1592 new_request.get(), | 1593 new_request.get(), |
1593 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( | 1594 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( |
1594 new_request->url())); | 1595 new_request->url())); |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1852 bool download, | 1853 bool download, |
1853 ResourceContext* context) { | 1854 ResourceContext* context) { |
1854 return new ResourceRequestInfoImpl( | 1855 return new ResourceRequestInfoImpl( |
1855 PROCESS_TYPE_RENDERER, | 1856 PROCESS_TYPE_RENDERER, |
1856 child_id, | 1857 child_id, |
1857 render_view_route_id, | 1858 render_view_route_id, |
1858 -1, // frame_tree_node_id | 1859 -1, // frame_tree_node_id |
1859 0, | 1860 0, |
1860 request_id_, | 1861 request_id_, |
1861 render_frame_route_id, | 1862 render_frame_route_id, |
1862 false, // is_main_frame | 1863 false, // is_main_frame |
1863 false, // parent_is_main_frame | 1864 false, // parent_is_main_frame |
1864 RESOURCE_TYPE_SUB_RESOURCE, | 1865 RESOURCE_TYPE_SUB_RESOURCE, |
1865 ui::PAGE_TRANSITION_LINK, | 1866 ui::PAGE_TRANSITION_LINK, |
1866 false, // should_replace_current_entry | 1867 false, // should_replace_current_entry |
1867 download, // is_download | 1868 download, // is_download |
1868 false, // is_stream | 1869 false, // is_stream |
1869 download, // allow_download | 1870 download, // allow_download |
1870 false, // has_user_gesture | 1871 false, // has_user_gesture |
1871 false, // enable_load_timing | 1872 false, // enable_load_timing |
1872 false, // enable_upload_progress | 1873 false, // enable_upload_progress |
1873 false, // do_not_prompt_for_login | 1874 false, // do_not_prompt_for_login |
1874 blink::WebReferrerPolicyDefault, | 1875 blink::WebReferrerPolicyDefault, |
1875 blink::WebPageVisibilityStateVisible, | 1876 blink::WebPageVisibilityStateVisible, |
1876 context, | 1877 context, |
1877 base::WeakPtr<ResourceMessageFilter>(), // filter | 1878 base::WeakPtr<ResourceMessageFilter>(), // filter |
1878 false, // report_raw_headers | 1879 false, // report_raw_headers |
1879 true, // is_async | 1880 true, // is_async |
1880 false, // is_using_lofi | 1881 false, // is_using_lofi |
1881 std::string()); // original_headers | 1882 std::string(), // original_headers |
| 1883 nullptr); // body |
1882 } | 1884 } |
1883 | 1885 |
1884 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( | 1886 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( |
1885 const GlobalFrameRoutingId& global_routing_id) { | 1887 const GlobalFrameRoutingId& global_routing_id) { |
1886 CancelRequestsForRoute(global_routing_id); | 1888 CancelRequestsForRoute(global_routing_id); |
1887 } | 1889 } |
1888 | 1890 |
1889 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, | 1891 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, |
1890 int route_id) { | 1892 int route_id) { |
1891 scheduler_->OnClientCreated(child_id, route_id); | 1893 scheduler_->OnClientCreated(child_id, route_id); |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2298 base::WeakPtr<ResourceMessageFilter>(), // filter | 2300 base::WeakPtr<ResourceMessageFilter>(), // filter |
2299 false, // request_data.report_raw_headers | 2301 false, // request_data.report_raw_headers |
2300 true, // is_async | 2302 true, // is_async |
2301 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, | 2303 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, |
2302 resource_context, info.is_main_frame), | 2304 resource_context, info.is_main_frame), |
2303 // The original_headers field is for stale-while-revalidate but the | 2305 // The original_headers field is for stale-while-revalidate but the |
2304 // feature doesn't work with PlzNavigate, so it's just a placeholder | 2306 // feature doesn't work with PlzNavigate, so it's just a placeholder |
2305 // here. | 2307 // here. |
2306 // TODO(ricea): Make the feature work with stale-while-revalidate | 2308 // TODO(ricea): Make the feature work with stale-while-revalidate |
2307 // and clean this up. | 2309 // and clean this up. |
2308 std::string()); // original_headers | 2310 std::string(), // original_headers |
| 2311 info.common_params.post_data); |
2309 // Request takes ownership. | 2312 // Request takes ownership. |
2310 extra_info->AssociateWithRequest(new_request.get()); | 2313 extra_info->AssociateWithRequest(new_request.get()); |
2311 | 2314 |
2312 if (new_request->url().SchemeIs(url::kBlobScheme)) { | 2315 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
2313 // Hang on to a reference to ensure the blob is not released prior | 2316 // Hang on to a reference to ensure the blob is not released prior |
2314 // to the job being started. | 2317 // to the job being started. |
2315 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 2318 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
2316 new_request.get(), | 2319 new_request.get(), |
2317 blob_context->GetBlobDataFromPublicURL(new_request->url())); | 2320 blob_context->GetBlobDataFromPublicURL(new_request->url())); |
2318 } | 2321 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
OLD | NEW |