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