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

Unified Diff: third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp

Issue 1578993002: Fix double resource request for script resources with integrity attr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2564
Patch Set: Created 4 years, 11 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/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 13165ba5a435e236c59281815e7812f868ac6699..bd5fa737f84b110576dec8f20fec23407420e819 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -35,7 +35,10 @@
#include "core/css/MediaValuesCached.h"
#include "core/css/parser/SizesAttributeParser.h"
#include "core/dom/Document.h"
+#include "core/fetch/IntegrityMetadata.h"
#include "core/frame/Settings.h"
+#include "core/frame/SubresourceIntegrity.h"
+#include "core/html/CrossOriginAttribute.h"
#include "core/html/HTMLImageElement.h"
#include "core/html/HTMLMetaElement.h"
#include "core/html/LinkRelAttribute.h"
@@ -204,6 +207,7 @@ public:
request->setCrossOriginEnabled(allowStoredCredentials());
request->setCharset(charset());
request->setDefer(m_defer);
+ request->setIntegrityMetadata(m_integrityMetadata);
return request.release();
}
@@ -220,6 +224,8 @@ private:
setDefer(FetchRequest::LazyLoad);
else if (match(attributeName, deferAttr))
setDefer(FetchRequest::LazyLoad);
+ else if (match(attributeName, integrityAttr))
+ SubresourceIntegrity::parseIntegrityAttribute(attributeValue, m_integrityMetadata);
}
template<typename NameType>
@@ -394,6 +400,7 @@ private:
void setDefer(FetchRequest::DeferOption defer)
{
m_defer = defer;
+
}
bool defer() const
@@ -420,6 +427,7 @@ private:
RefPtrWillBeMember<MediaValues> m_mediaValues;
bool m_referrerPolicySet;
ReferrerPolicy m_referrerPolicy;
+ IntegrityMetadataSet m_integrityMetadata;
};
TokenPreloadScanner::TokenPreloadScanner(const KURL& documentURL, PassOwnPtr<CachedDocumentParameters> documentParameters)
« no previous file with comments | « third_party/WebKit/Source/core/fetch/ScriptResource.cpp ('k') | third_party/WebKit/Source/core/html/parser/PreloadRequest.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698