| 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 1562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1844 loader->CancelRequest(true); | 1845 loader->CancelRequest(true); |
| 1845 } | 1846 } |
| 1846 | 1847 |
| 1847 ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( | 1848 ResourceRequestInfoImpl* ResourceDispatcherHostImpl::CreateRequestInfo( |
| 1848 int child_id, | 1849 int child_id, |
| 1849 int render_view_route_id, | 1850 int render_view_route_id, |
| 1850 int render_frame_route_id, | 1851 int render_frame_route_id, |
| 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, child_id, render_view_route_id, |
| 1855 child_id, | |
| 1856 render_view_route_id, | |
| 1857 -1, // frame_tree_node_id | 1856 -1, // frame_tree_node_id |
| 1858 0, | 1857 0, request_id_, render_frame_route_id, |
| 1859 request_id_, | 1858 false, // is_main_frame |
| 1860 render_frame_route_id, | 1859 false, // parent_is_main_frame |
| 1861 false, // is_main_frame | 1860 RESOURCE_TYPE_SUB_RESOURCE, ui::PAGE_TRANSITION_LINK, |
| 1862 false, // parent_is_main_frame | |
| 1863 RESOURCE_TYPE_SUB_RESOURCE, | |
| 1864 ui::PAGE_TRANSITION_LINK, | |
| 1865 false, // should_replace_current_entry | 1861 false, // should_replace_current_entry |
| 1866 download, // is_download | 1862 download, // is_download |
| 1867 false, // is_stream | 1863 false, // is_stream |
| 1868 download, // allow_download | 1864 download, // allow_download |
| 1869 false, // has_user_gesture | 1865 false, // has_user_gesture |
| 1870 false, // enable_load_timing | 1866 false, // enable_load_timing |
| 1871 false, // enable_upload_progress | 1867 false, // enable_upload_progress |
| 1872 false, // do_not_prompt_for_login | 1868 false, // do_not_prompt_for_login |
| 1873 blink::WebReferrerPolicyDefault, | 1869 blink::WebReferrerPolicyDefault, blink::WebPageVisibilityStateVisible, |
| 1874 blink::WebPageVisibilityStateVisible, | |
| 1875 context, | 1870 context, |
| 1876 base::WeakPtr<ResourceMessageFilter>(), // filter | 1871 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 1877 false, // report_raw_headers | 1872 false, // report_raw_headers |
| 1878 true, // is_async | 1873 true, // is_async |
| 1879 false, // is_using_lofi | 1874 false, // is_using_lofi |
| 1880 std::string()); // original_headers | 1875 std::string(), // original_headers |
| 1876 nullptr); // body |
| 1881 } | 1877 } |
| 1882 | 1878 |
| 1883 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( | 1879 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( |
| 1884 const GlobalFrameRoutingId& global_routing_id) { | 1880 const GlobalFrameRoutingId& global_routing_id) { |
| 1885 CancelRequestsForRoute(global_routing_id); | 1881 CancelRequestsForRoute(global_routing_id); |
| 1886 } | 1882 } |
| 1887 | 1883 |
| 1888 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, | 1884 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, |
| 1889 int route_id) { | 1885 int route_id) { |
| 1890 scheduler_->OnClientCreated(child_id, route_id); | 1886 scheduler_->OnClientCreated(child_id, route_id); |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2299 base::WeakPtr<ResourceMessageFilter>(), // filter | 2295 base::WeakPtr<ResourceMessageFilter>(), // filter |
| 2300 false, // request_data.report_raw_headers | 2296 false, // request_data.report_raw_headers |
| 2301 true, // is_async | 2297 true, // is_async |
| 2302 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, | 2298 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, |
| 2303 resource_context, info.is_main_frame), | 2299 resource_context, info.is_main_frame), |
| 2304 // The original_headers field is for stale-while-revalidate but the | 2300 // The original_headers field is for stale-while-revalidate but the |
| 2305 // feature doesn't work with PlzNavigate, so it's just a placeholder | 2301 // feature doesn't work with PlzNavigate, so it's just a placeholder |
| 2306 // here. | 2302 // here. |
| 2307 // TODO(ricea): Make the feature work with stale-while-revalidate | 2303 // TODO(ricea): Make the feature work with stale-while-revalidate |
| 2308 // and clean this up. | 2304 // and clean this up. |
| 2309 std::string()); // original_headers | 2305 std::string(), // original_headers |
| 2306 info.request_body); |
| 2310 // Request takes ownership. | 2307 // Request takes ownership. |
| 2311 extra_info->AssociateWithRequest(new_request.get()); | 2308 extra_info->AssociateWithRequest(new_request.get()); |
| 2312 | 2309 |
| 2313 if (new_request->url().SchemeIs(url::kBlobScheme)) { | 2310 if (new_request->url().SchemeIs(url::kBlobScheme)) { |
| 2314 // Hang on to a reference to ensure the blob is not released prior | 2311 // Hang on to a reference to ensure the blob is not released prior |
| 2315 // to the job being started. | 2312 // to the job being started. |
| 2316 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( | 2313 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( |
| 2317 new_request.get(), | 2314 new_request.get(), |
| 2318 blob_context->GetBlobDataFromPublicURL(new_request->url())); | 2315 blob_context->GetBlobDataFromPublicURL(new_request->url())); |
| 2319 } | 2316 } |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2688 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); | 2685 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); |
| 2689 response->head.security_info = SerializeSecurityInfo(ssl); | 2686 response->head.security_info = SerializeSecurityInfo(ssl); |
| 2690 } | 2687 } |
| 2691 | 2688 |
| 2692 CertStore* ResourceDispatcherHostImpl::GetCertStore() { | 2689 CertStore* ResourceDispatcherHostImpl::GetCertStore() { |
| 2693 return cert_store_for_testing_ ? cert_store_for_testing_ | 2690 return cert_store_for_testing_ ? cert_store_for_testing_ |
| 2694 : CertStore::GetInstance(); | 2691 : CertStore::GetInstance(); |
| 2695 } | 2692 } |
| 2696 | 2693 |
| 2697 } // namespace content | 2694 } // namespace content |
| OLD | NEW |