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

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

Issue 1569623002: Fix-up some code relating to SRI double-requesting scripts (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: More fixes 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 3afe9168a531d44219c1e54d5444991219632c7a..efff3e4086f4357f8431fba26c2cbea20f5583f1 100644
--- a/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
+++ b/third_party/WebKit/Source/core/html/parser/HTMLPreloadScanner.cpp
@@ -221,6 +221,14 @@ private:
setDefer(FetchRequest::LazyLoad);
else if (match(attributeName, deferAttr))
setDefer(FetchRequest::LazyLoad);
+ // Note that only scripts need to have the integrity metadata set on
+ // preloads. This is because script resources fetches, and only script
+ // resource fetches, need to re-request resources if a cached version
+ // has different metadata (including empty) from the metadata on the
+ // request. See the comment before the call to
+ // mustRefetchDueToIntegrityMismatch() in
+ // Source/core/fetch/ResourceFetcher.cpp for a more complete
+ // explanation.
else if (match(attributeName, integrityAttr))
SubresourceIntegrity::parseIntegrityAttribute(attributeValue, m_integrityMetadata);
}
@@ -382,7 +390,6 @@ private:
void setDefer(FetchRequest::DeferOption defer)
{
m_defer = defer;
-
}
bool defer() const
« no previous file with comments | « third_party/WebKit/Source/core/dom/ScriptLoader.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