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

Side by Side Diff: third_party/WebKit/Source/core/loader/FrameLoader.cpp

Issue 2892903002: Renamed `embedding-csp` HTTP request header to `required-csp`. (Closed)
Patch Set: Created 3 years, 7 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 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights
3 * reserved. 3 * reserved.
4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 4 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. 5 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved.
6 * (http://www.torchmobile.com/) 6 * (http://www.torchmobile.com/)
7 * Copyright (C) 2008 Alp Toker <alp@atoker.com> 7 * Copyright (C) 2008 Alp Toker <alp@atoker.com>
8 * Copyright (C) Research In Motion Limited 2009. All rights reserved. 8 * Copyright (C) Research In Motion Limited 2009. All rights reserved.
9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com> 9 * Copyright (C) 2011 Kris Jordan <krisjordan@gmail.com>
10 * Copyright (C) 2011 Google Inc. All rights reserved. 10 * Copyright (C) 2011 Google Inc. All rights reserved.
(...skipping 1587 matching lines...) Expand 10 before | Expand all | Expand 10 after
1598 ->GetDocument() 1598 ->GetDocument()
1599 ->InsecureNavigationsToUpgrade(); 1599 ->InsecureNavigationsToUpgrade();
1600 } 1600 }
1601 1601
1602 void FrameLoader::ModifyRequestForCSP(ResourceRequest& resource_request, 1602 void FrameLoader::ModifyRequestForCSP(ResourceRequest& resource_request,
1603 Document* document) const { 1603 Document* document) const {
1604 if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() && 1604 if (RuntimeEnabledFeatures::embedderCSPEnforcementEnabled() &&
1605 !RequiredCSP().IsEmpty()) { 1605 !RequiredCSP().IsEmpty()) {
1606 // TODO(amalika): Strengthen this DCHECK that requiredCSP has proper format 1606 // TODO(amalika): Strengthen this DCHECK that requiredCSP has proper format
1607 DCHECK(RequiredCSP().GetString().ContainsOnlyASCII()); 1607 DCHECK(RequiredCSP().GetString().ContainsOnlyASCII());
1608 resource_request.SetHTTPHeaderField(HTTPNames::Embedding_CSP, 1608 resource_request.SetHTTPHeaderField(HTTPNames::Required_CSP, RequiredCSP());
1609 RequiredCSP());
1610 } 1609 }
1611 1610
1612 // Tack an 'Upgrade-Insecure-Requests' header to outgoing navigational 1611 // Tack an 'Upgrade-Insecure-Requests' header to outgoing navigational
1613 // requests, as described in 1612 // requests, as described in
1614 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect 1613 // https://w3c.github.io/webappsec/specs/upgrade/#feature-detect
1615 if (resource_request.GetFrameType() != WebURLRequest::kFrameTypeNone) { 1614 if (resource_request.GetFrameType() != WebURLRequest::kFrameTypeNone) {
1616 // Early return if the request has already been upgraded. 1615 // Early return if the request has already been upgraded.
1617 if (!resource_request.HttpHeaderField(HTTPNames::Upgrade_Insecure_Requests) 1616 if (!resource_request.HttpHeaderField(HTTPNames::Upgrade_Insecure_Requests)
1618 .IsNull()) { 1617 .IsNull()) {
1619 return; 1618 return;
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
1711 // TODO(japhet): This is needed because the browser process DCHECKs if the 1710 // TODO(japhet): This is needed because the browser process DCHECKs if the
1712 // first entry we commit in a new frame has replacement set. It's unclear 1711 // first entry we commit in a new frame has replacement set. It's unclear
1713 // whether the DCHECK is right, investigate removing this special case. 1712 // whether the DCHECK is right, investigate removing this special case.
1714 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem && 1713 bool replace_current_item = load_type == kFrameLoadTypeReplaceCurrentItem &&
1715 (!Opener() || !request.Url().IsEmpty()); 1714 (!Opener() || !request.Url().IsEmpty());
1716 loader->SetReplacesCurrentHistoryItem(replace_current_item); 1715 loader->SetReplacesCurrentHistoryItem(replace_current_item);
1717 return loader; 1716 return loader;
1718 } 1717 }
1719 1718
1720 } // namespace blink 1719 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698