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

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

Issue 2333513002: Fix SSL redirects with PlzNavigate. (Closed)
Patch Set: slightly different fix Created 4 years, 3 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after
1357 new URLRequestServiceWorkerData()); 1357 new URLRequestServiceWorkerData());
1358 } 1358 }
1359 1359
1360 // If the request is a MAIN_FRAME request, the first-party URL gets updated on 1360 // If the request is a MAIN_FRAME request, the first-party URL gets updated on
1361 // redirects. 1361 // redirects.
1362 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) { 1362 if (request_data.resource_type == RESOURCE_TYPE_MAIN_FRAME) {
1363 new_request->set_first_party_url_policy( 1363 new_request->set_first_party_url_policy(
1364 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT); 1364 net::URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT);
1365 } 1365 }
1366 1366
1367 const Referrer referrer(request_data.referrer, request_data.referrer_policy); 1367 // For PlzNavigate, this request has already been made and the referrer was
1368 SetReferrerForRequest(new_request.get(), referrer); 1368 // checked previously. So don't set the referrer for this stream request, or
1369 // else it will fail for SSL redirects since net/ will think the blob:https
1370 // for the stream is not a secure scheme (specifically, in the call to
1371 // ComputeReferrerForRedirect).
1372 if (!is_navigation_stream_request) {
1373 const Referrer referrer(
1374 request_data.referrer, request_data.referrer_policy);
1375 SetReferrerForRequest(new_request.get(), referrer);
1376 }
1369 1377
1370 new_request->SetExtraRequestHeaders(headers); 1378 new_request->SetExtraRequestHeaders(headers);
1371 1379
1372 storage::BlobStorageContext* blob_context = 1380 storage::BlobStorageContext* blob_context =
1373 GetBlobStorageContext(filter_->blob_storage_context()); 1381 GetBlobStorageContext(filter_->blob_storage_context());
1374 // Resolve elements from request_body and prepare upload data. 1382 // Resolve elements from request_body and prepare upload data.
1375 if (request_data.request_body.get()) { 1383 if (request_data.request_body.get()) {
1376 // |blob_context| could be null when the request is from the plugins because 1384 // |blob_context| could be null when the request is from the plugins because
1377 // ResourceMessageFilters created in PluginProcessHost don't have the blob 1385 // ResourceMessageFilters created in PluginProcessHost don't have the blob
1378 // context. 1386 // context.
(...skipping 1316 matching lines...) Expand 10 before | Expand all | Expand 10 after
2695 request_info->GetRouteID(), is_content_initiated, true, &throttles); 2703 request_info->GetRouteID(), is_content_initiated, true, &throttles);
2696 if (!throttles.empty()) { 2704 if (!throttles.empty()) {
2697 handler.reset(new ThrottlingResourceHandler(std::move(handler), request, 2705 handler.reset(new ThrottlingResourceHandler(std::move(handler), request,
2698 std::move(throttles))); 2706 std::move(throttles)));
2699 } 2707 }
2700 } 2708 }
2701 return handler; 2709 return handler;
2702 } 2710 }
2703 2711
2704 } // namespace content 2712 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698