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

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

Issue 2445993006: [WIP] Upgrade-insecure-request: upgrade insecurely-redirected requests.
Patch Set: bugfix Created 4 years, 1 month 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 1511 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 false, // is stream 1522 false, // is stream
1523 allow_download, request_data.has_user_gesture, 1523 allow_download, request_data.has_user_gesture,
1524 request_data.enable_load_timing, request_data.enable_upload_progress, 1524 request_data.enable_load_timing, request_data.enable_upload_progress,
1525 do_not_prompt_for_login, request_data.referrer_policy, 1525 do_not_prompt_for_login, request_data.referrer_policy,
1526 request_data.visibility_state, resource_context, filter_->GetWeakPtr(), 1526 request_data.visibility_state, resource_context, filter_->GetWeakPtr(),
1527 report_raw_headers, !is_sync_load, 1527 report_raw_headers, !is_sync_load,
1528 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request, 1528 IsUsingLoFi(request_data.lofi_state, delegate_, *new_request,
1529 resource_context, 1529 resource_context,
1530 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME), 1530 request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME),
1531 support_async_revalidation ? request_data.headers : std::string(), 1531 support_async_revalidation ? request_data.headers : std::string(),
1532 request_data.request_body, request_data.initiated_in_secure_context); 1532 request_data.request_body, request_data.initiated_in_secure_context,
1533 request_data.insecure_request_policy);
1533 // Request takes ownership. 1534 // Request takes ownership.
1534 extra_info->AssociateWithRequest(new_request.get()); 1535 extra_info->AssociateWithRequest(new_request.get());
1535 1536
1536 if (new_request->url().SchemeIs(url::kBlobScheme)) { 1537 if (new_request->url().SchemeIs(url::kBlobScheme)) {
1537 // Hang on to a reference to ensure the blob is not released prior 1538 // Hang on to a reference to ensure the blob is not released prior
1538 // to the job being started. 1539 // to the job being started.
1539 storage::BlobProtocolHandler::SetRequestedBlobDataHandle( 1540 storage::BlobProtocolHandler::SetRequestedBlobDataHandle(
1540 new_request.get(), 1541 new_request.get(),
1541 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL( 1542 filter_->blob_storage_context()->context()->GetBlobDataFromPublicURL(
1542 new_request->url())); 1543 new_request->url()));
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
1849 false, // enable_upload_progress 1850 false, // enable_upload_progress
1850 false, // do_not_prompt_for_login 1851 false, // do_not_prompt_for_login
1851 blink::WebReferrerPolicyDefault, blink::WebPageVisibilityStateVisible, 1852 blink::WebReferrerPolicyDefault, blink::WebPageVisibilityStateVisible,
1852 context, 1853 context,
1853 base::WeakPtr<ResourceMessageFilter>(), // filter 1854 base::WeakPtr<ResourceMessageFilter>(), // filter
1854 false, // report_raw_headers 1855 false, // report_raw_headers
1855 true, // is_async 1856 true, // is_async
1856 false, // is_using_lofi 1857 false, // is_using_lofi
1857 std::string(), // original_headers 1858 std::string(), // original_headers
1858 nullptr, // body 1859 nullptr, // body
1859 false); // initiated_in_secure_context 1860 false, // initiated_in_secure_context
1861 blink::kLeaveInsecureRequestsAlone); // insecure_request_policy
1862
1860 } 1863 }
1861 1864
1862 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id, 1865 void ResourceDispatcherHostImpl::OnRenderViewHostCreated(int child_id,
1863 int route_id) { 1866 int route_id) {
1864 scheduler_->OnClientCreated(child_id, route_id); 1867 scheduler_->OnClientCreated(child_id, route_id);
1865 } 1868 }
1866 1869
1867 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted(int child_id, 1870 void ResourceDispatcherHostImpl::OnRenderViewHostDeleted(int child_id,
1868 int route_id) { 1871 int route_id) {
1869 scheduler_->OnClientDeleted(child_id, route_id); 1872 scheduler_->OnClientDeleted(child_id, route_id);
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after
2228 // feature doesn't work with PlzNavigate, so it's just a placeholder 2231 // feature doesn't work with PlzNavigate, so it's just a placeholder
2229 // here. 2232 // here.
2230 // TODO(ricea): Make the feature work with stale-while-revalidate 2233 // TODO(ricea): Make the feature work with stale-while-revalidate
2231 // and clean this up. 2234 // and clean this up.
2232 std::string(), // original_headers 2235 std::string(), // original_headers
2233 info.common_params.post_data, 2236 info.common_params.post_data,
2234 // TODO(mek): Currently initiated_in_secure_context is only used for 2237 // TODO(mek): Currently initiated_in_secure_context is only used for
2235 // subresource requests, so it doesn't matter what value it gets here. 2238 // subresource requests, so it doesn't matter what value it gets here.
2236 // If in the future this changes this should be updated to somehow get a 2239 // If in the future this changes this should be updated to somehow get a
2237 // meaningful value. 2240 // meaningful value.
2238 false); // initiated_in_secure_context 2241 false, // initiated_in_secure_context
2242 info.insecure_request_policy);
2239 extra_info->set_navigation_ui_data(std::move(navigation_ui_data)); 2243 extra_info->set_navigation_ui_data(std::move(navigation_ui_data));
2240 2244
2241 if (service_worker_handle_core) { 2245 if (service_worker_handle_core) {
2242 extra_info->set_service_worker_context( 2246 extra_info->set_service_worker_context(
2243 service_worker_handle_core->context_wrapper()); 2247 service_worker_handle_core->context_wrapper());
2244 } 2248 }
2245 2249
2246 // Request takes ownership. 2250 // Request takes ownership.
2247 extra_info->AssociateWithRequest(new_request.get()); 2251 extra_info->AssociateWithRequest(new_request.get());
2248 2252
(...skipping 541 matching lines...) Expand 10 before | Expand all | Expand 10 after
2790 &throttles); 2794 &throttles);
2791 if (!throttles.empty()) { 2795 if (!throttles.empty()) {
2792 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2796 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2793 std::move(throttles))); 2797 std::move(throttles)));
2794 } 2798 }
2795 } 2799 }
2796 return handler; 2800 return handler;
2797 } 2801 }
2798 2802
2799 } // namespace content 2803 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/loader/navigation_url_loader_unittest.cc ('k') | content/browser/loader/resource_dispatcher_host_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698