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

Unified Diff: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp

Issue 2056183002: Implement the `require-sri-for` CSP directive (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated tests Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
diff --git a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
index 3976a5982562c857f8bef8ab7bfbf85fbf0d45c0..d6de4c946d35e2208ecc4f8ab3ae39c460b4f745 100644
--- a/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
+++ b/third_party/WebKit/Source/core/html/HTMLLinkElement.cpp
@@ -753,6 +753,13 @@ void LinkStyle::process()
request.setCrossOriginAccessControl(document().getSecurityOrigin(), crossOrigin);
setFetchFollowingCORS();
}
+
+ String integrityAttr = m_owner->fastGetAttribute(HTMLNames::integrityAttr);
+ if (!integrityAttr.isEmpty()) {
+ IntegrityMetadataSet metadataSet;
+ SubresourceIntegrity::parseIntegrityAttribute(integrityAttr, metadataSet);
+ request.setIntegrityMetadata(metadataSet);
+ }
setResource(CSSStyleSheetResource::fetch(request, document().fetcher()));
if (m_loading && !resource()) {

Powered by Google App Engine
This is Rietveld 408576698