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

Unified Diff: third_party/WebKit/Source/core/fetch/ScriptResource.h

Issue 1713093002: Fix SRI bypass by loading same resource twice in same origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@2623
Patch Set: Created 4 years, 10 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/fetch/ScriptResource.h
diff --git a/third_party/WebKit/Source/core/fetch/ScriptResource.h b/third_party/WebKit/Source/core/fetch/ScriptResource.h
index 79eaff54451366e00ffbf6dc6048fe8bde3308d1..10d295579b3a7a7225ef81db82280a5bb018bd3e 100644
--- a/third_party/WebKit/Source/core/fetch/ScriptResource.h
+++ b/third_party/WebKit/Source/core/fetch/ScriptResource.h
@@ -33,6 +33,12 @@
namespace blink {
+enum class ScriptIntegrityDisposition {
+ NotChecked = 0,
+ Failed,
+ Passed
+};
+
class FetchRequest;
class ScriptResource;
@@ -70,8 +76,9 @@ public:
void setIntegrityMetadata(const IntegrityMetadataSet& metadata) { m_integrityMetadata = metadata; }
const IntegrityMetadataSet& integrityMetadata() const { return m_integrityMetadata; }
- void setIntegrityAlreadyChecked(bool checked) { m_integrityChecked = checked; }
- bool integrityAlreadyChecked() { return m_integrityChecked; }
+ // The argument must never be |NotChecked|.
+ void setIntegrityDisposition(ScriptIntegrityDisposition);
+ ScriptIntegrityDisposition integrityDisposition() { return m_integrityDisposition; }
bool mustRefetchDueToIntegrityMetadata(const FetchRequest&) const override;
private:
@@ -86,7 +93,7 @@ private:
}
};
- bool m_integrityChecked;
+ ScriptIntegrityDisposition m_integrityDisposition;
IntegrityMetadataSet m_integrityMetadata;
AtomicString m_script;
« no previous file with comments | « third_party/WebKit/Source/core/dom/PendingScript.cpp ('k') | third_party/WebKit/Source/core/fetch/ScriptResource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698