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

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

Issue 1914593002: Limit requests for which link headers can install service workers to secure contexts. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add more tests Created 4 years, 6 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 1526 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 false, // is stream 1537 false, // is stream
1538 allow_download, request_data.has_user_gesture, 1538 allow_download, request_data.has_user_gesture,
1539 request_data.enable_load_timing, request_data.enable_upload_progress, 1539 request_data.enable_load_timing, request_data.enable_upload_progress,
1540 do_not_prompt_for_login, request_data.referrer_policy, 1540 do_not_prompt_for_login, request_data.referrer_policy,
1541 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(), 1541 request_data.visiblity_state, resource_context, filter_->GetWeakPtr(),
1542 report_raw_headers, !is_sync_load, 1542 report_raw_headers, !is_sync_load,
1543 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request, 1543 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request,
1544 resource_context, 1544 resource_context,
1545 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME), 1545 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME),
1546 support_async_revalidation ? request_data.headers : std::string(), 1546 support_async_revalidation ? request_data.headers : std::string(),
1547 request_data.request_body); 1547 request_data.request_body, request_data.initiated_in_secure_context);
1548 // Request takes ownership. 1548 // Request takes ownership.
1549 extra_info->AssociateWithRequest(new_request.get()); 1549 extra_info->AssociateWithRequest(new_request.get());
1550 1550
1551 if (new_request->url().SchemeIs(url::kBlobScheme)) { 1551 if (new_request->url().SchemeIs(url::kBlobScheme)) {
1552 // Hang on to a reference to ensure the blob is not released prior 1552 // Hang on to a reference to ensure the blob is not released prior
1553 // to the job being started. 1553 // to the job being started.
1554 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1554 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1555 new_request.get(), 1555 new_request.get(),
1556 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( 1556 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL(
1557 new_request->url())); 1557 new_request->url()));
(...skipping 279 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 false, // enable_upload_progress 1837 false, // enable_upload_progress
1838 false, // do_not_prompt_for_login 1838 false, // do_not_prompt_for_login
1839 blink::WebReferrerPolicyDefault, 1839 blink::WebReferrerPolicyDefault,
1840 blink::WebPageVisibilityStateVisible, 1840 blink::WebPageVisibilityStateVisible,
1841 context, 1841 context,
1842 base::WeakPtr<ResourceMessageFilter>(), // filter 1842 base::WeakPtr<ResourceMessageFilter>(), // filter
1843 false, // report_raw_headers 1843 false, // report_raw_headers
1844 true, // is_async 1844 true, // is_async
1845 false, // is_using_lofi 1845 false, // is_using_lofi
1846 std::string(), // original_headers 1846 std::string(), // original_headers
1847 nullptr); // body 1847 nullptr, // body
1848 false); // initiated_in_secure_context
1848 } 1849 }
1849 1850
1850 void ResourceDispatcherHostImpl::OnRenderFrameDeleted( 1851 void ResourceDispatcherHostImpl::OnRenderFrameDeleted(
1851 const GlobalFrameRoutingId& global_routing_id) { 1852 const GlobalFrameRoutingId& global_routing_id) {
1852 CancelRequestsForRoute(global_routing_id); 1853 CancelRequestsForRoute(global_routing_id);
1853 } 1854 }
1854 1855
1855 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, 1856 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id,
1856 int route_id) { 1857 int route_id) {
1857 scheduler_->OnClientCreated(child_id, route_id); 1858 scheduler_->OnClientCreated(child_id, route_id);
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after
2252 false, // request_data.report_raw_headers 2253 false, // request_data.report_raw_headers
2253 true, // is_async 2254 true, // is_async
2254 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request, 2255 IsUsingLoFi(info.common_params.lofi_state, delegate_, *new_request,
2255 resource_context, info.is_main_frame), 2256 resource_context, info.is_main_frame),
2256 // The original_headers field is for stale-while-revalidate but the 2257 // The original_headers field is for stale-while-revalidate but the
2257 // feature doesn't work with PlzNavigate, so it's just a placeholder 2258 // feature doesn't work with PlzNavigate, so it's just a placeholder
2258 // here. 2259 // here.
2259 // TODO(ricea): Make the feature work with stale-while-revalidate 2260 // TODO(ricea): Make the feature work with stale-while-revalidate
2260 // and clean this up. 2261 // and clean this up.
2261 std::string(), // original_headers 2262 std::string(), // original_headers
2262 info.common_params.post_data); 2263 info.common_params.post_data,
2264 false); // initiated_in_secure_context
kinuko 2016/06/23 14:42:27 when we're enabling plznavigate how will we handle
Marijn Kruisselbrink 2016/06/23 18:02:01 Added a TODO. At least it doesn't matter for the l
2263 // Request takes ownership. 2265 // Request takes ownership.
2264 extra_info->AssociateWithRequest(new_request.get()); 2266 extra_info->AssociateWithRequest(new_request.get());
2265 2267
2266 if (new_request->url().SchemeIs(url::kBlobScheme)) { 2268 if (new_request->url().SchemeIs(url::kBlobScheme)) {
2267 // Hang on to a reference to ensure the blob is not released prior 2269 // Hang on to a reference to ensure the blob is not released prior
2268 // to the job being started. 2270 // to the job being started.
2269 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 2271 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
2270 new_request.get(), 2272 new_request.get(),
2271 blob_context->GetBlobDataFromPublicURL(new_request->url())); 2273 blob_context->GetBlobDataFromPublicURL(new_request->url()));
2272 } 2274 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
2642 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id); 2644 ssl.cert_id = GetCertStore()->StoreCert(ssl_info.cert.get(), child_id);
2643 response->head.security_info = SerializeSecurityInfo(ssl); 2645 response->head.security_info = SerializeSecurityInfo(ssl);
2644 } 2646 }
2645 2647
2646 CertStore* ResourceDispatcherHostImpl::GetCertStore() { 2648 CertStore* ResourceDispatcherHostImpl::GetCertStore() {
2647 return cert_store_for_testing_ ? cert_store_for_testing_ 2649 return cert_store_for_testing_ ? cert_store_for_testing_
2648 : CertStore::GetInstance(); 2650 : CertStore::GetInstance();
2649 } 2651 }
2650 2652
2651 } // namespace content 2653 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698