Index: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
diff --git a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
index 14ecba3af799fc287ea7b8df14d276a57f7e19fe..09e657f9aa8888892779c69314f82f0629107f1a 100644 |
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp |
@@ -243,6 +243,7 @@ public: |
ReferrerPolicy referrerPolicy = (m_referrerPolicy != ReferrerPolicyDefault) ? m_referrerPolicy : documentReferrerPolicy; |
std::unique_ptr<PreloadRequest> request = PreloadRequest::create(initiatorFor(m_tagImpl), position, m_urlToLoad, predictedBaseURL, type, referrerPolicy, resourceWidth, clientHintsPreferences, requestType); |
request->setCrossOrigin(m_crossOrigin); |
+ request->setNonce(m_nonce); |
request->setCharset(charset()); |
request->setDefer(m_defer); |
request->setIntegrityMetadata(m_integrityMetadata); |
@@ -258,6 +259,8 @@ private: |
setUrlToLoad(attributeValue, DisallowURLReplacement); |
else if (match(attributeName, crossoriginAttr)) |
setCrossOrigin(attributeValue); |
+ else if (match(attributeName, nonceAttr)) |
+ setNonce(attributeValue); |
else if (match(attributeName, asyncAttr)) |
setDefer(FetchRequest::LazyLoad); |
else if (match(attributeName, deferAttr)) |
@@ -315,6 +318,8 @@ private: |
m_matched &= mediaAttributeMatches(*m_mediaValues, attributeValue); |
} else if (match(attributeName, crossoriginAttr)) { |
setCrossOrigin(attributeValue); |
+ } else if (match(attributeName, nonceAttr)) { |
+ setNonce(attributeValue); |
} else if (match(attributeName, asAttr)) { |
m_asAttributeValue = attributeValue; |
} else if (match(attributeName, typeAttr)) { |
@@ -448,6 +453,11 @@ private: |
m_crossOrigin = crossOriginAttributeValue(corsSetting); |
} |
+ void setNonce(const String& nonce) |
+ { |
+ m_nonce = nonce; |
+ } |
+ |
void setDefer(FetchRequest::DeferOption defer) |
{ |
m_defer = defer; |
@@ -475,6 +485,7 @@ private: |
bool m_sourceSizeSet; |
FetchRequest::DeferOption m_defer; |
CrossOriginAttributeValue m_crossOrigin; |
+ String m_nonce; |
Member<MediaValuesCached> m_mediaValues; |
bool m_referrerPolicySet; |
ReferrerPolicy m_referrerPolicy; |