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

Unified Diff: content/common/content_security_policy/csp_source.h

Issue 2792013002: Stop CSP from matching independent scheme/port upgrades (content layer) (Closed)
Patch Set: Created 3 years, 9 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: content/common/content_security_policy/csp_source.h
diff --git a/content/common/content_security_policy/csp_source.h b/content/common/content_security_policy/csp_source.h
index 62670ed77f89d43a75be9f0c28128643887bb888..2c18b3127f12ed0892afc8ec4484988319f68743 100644
--- a/content/common/content_security_policy/csp_source.h
+++ b/content/common/content_security_policy/csp_source.h
@@ -24,6 +24,20 @@ class CSPContext;
// - 'self'
// - *
struct CONTENT_EXPORT CSPSource {
+ // NotMatching is the only negative member, the rest are different types of
+ // matches. NotMatching should always be 0 to let if statements work nicely
+ enum class PortMatchingResult {
+ NotMatching,
+ MatchingWildcard,
+ MatchingUpgrade,
+ MatchingExact
+ };
+ enum class SchemeMatchingResult {
+ NotMatching,
+ MatchingUpgrade,
+ MatchingExact
+ };
+
arthursonzogni 2017/04/07 09:20:27 Can you please put these enums inside the implemen
andypaicu 2017/04/07 11:34:24 Done
CSPSource();
CSPSource(const std::string& scheme,
const std::string& host,

Powered by Google App Engine
This is Rietveld 408576698