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

Unified Diff: third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h

Issue 2896833002: Added validation of the policy specified in the 'csp' attribute (Closed)
Patch Set: Fixed incomplete validation. Added more tests inspired by existing source parsing tests. Created 3 years, 7 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/frame/csp/CSPDirectiveList.h
diff --git a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
index 667724a324a4bd33677d1a23a1e1315aa2eea41b..3c2fca38fee4aa742bc0995966ea4e0c754c21e4 100644
--- a/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
+++ b/third_party/WebKit/Source/core/frame/csp/CSPDirectiveList.h
@@ -39,6 +39,14 @@ class CORE_EXPORT CSPDirectiveList
void Parse(const UChar* begin, const UChar* end);
+ static bool IsValid(const UChar* begin,
+ const UChar* end,
+ ContentSecurityPolicyHeaderType,
+ ContentSecurityPolicyHeaderSource);
+ static bool IsValid(const String& directive_list,
+ ContentSecurityPolicyHeaderType,
+ ContentSecurityPolicyHeaderSource);
+
const String& Header() const { return header_; }
ContentSecurityPolicyHeaderType HeaderType() const { return header_type_; }
ContentSecurityPolicyHeaderSource HeaderSource() const {

Powered by Google App Engine
This is Rietveld 408576698