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

Side by Side Diff: third_party/WebKit/Source/core/frame/csp/CSPSource.h

Issue 2470083002: Part 2.1: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Rebasing on part1.1 Created 4 years, 1 month 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CSPSource_h 5 #ifndef CSPSource_h
6 #define CSPSource_h 6 #define CSPSource_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "core/frame/csp/ContentSecurityPolicy.h" 9 #include "core/frame/csp/ContentSecurityPolicy.h"
10 #include "platform/heap/Handle.h" 10 #include "platform/heap/Handle.h"
(...skipping 18 matching lines...) Expand all
29 WildcardDisposition hostWildcard, 29 WildcardDisposition hostWildcard,
30 WildcardDisposition portWildcard); 30 WildcardDisposition portWildcard);
31 bool matches(const KURL&, 31 bool matches(const KURL&,
32 ResourceRequest::RedirectStatus = 32 ResourceRequest::RedirectStatus =
33 ResourceRequest::RedirectStatus::NoRedirect) const; 33 ResourceRequest::RedirectStatus::NoRedirect) const;
34 34
35 // Check whether this CSPSource is subsuming of a given CSPSource for a 35 // Check whether this CSPSource is subsuming of a given CSPSource for a
36 // subsumption algorithm described here: 36 // subsumption algorithm described here:
37 // https://w3c.github.io/webappsec-csp/embedded/#subsume-policy 37 // https://w3c.github.io/webappsec-csp/embedded/#subsume-policy
38 bool subsumes(CSPSource*); 38 bool subsumes(CSPSource*);
39 // Retrieve the most restrictive information from the two CSPSources if
40 // isSimilar is true for the two. Otherwise, return nullptr.
41 CSPSource* getNormalized(CSPSource*);
jochen (gone - plz use gerrit) 2016/11/04 13:14:51 what about static CSPSource* intersect(CSPSource*
39 42
40 DECLARE_TRACE(); 43 DECLARE_TRACE();
41 44
42 private: 45 private:
46 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar);
47 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetNormalizedCSPSources);
48
43 bool schemeMatches(const String&) const; 49 bool schemeMatches(const String&) const;
44 bool hostMatches(const String&) const; 50 bool hostMatches(const String&) const;
45 bool pathMatches(const String&) const; 51 bool pathMatches(const String&) const;
46 // Protocol is necessary to determine default port if it is zero. 52 // Protocol is necessary to determine default port if it is zero.
47 bool portMatches(int port, const String& protocol) const; 53 bool portMatches(int port, const String& protocol) const;
48 bool isSchemeOnly() const; 54 bool isSchemeOnly() const;
55 bool isSimilar(CSPSource* other);
49 56
50 Member<ContentSecurityPolicy> m_policy; 57 Member<ContentSecurityPolicy> m_policy;
51 String m_scheme; 58 String m_scheme;
52 String m_host; 59 String m_host;
53 int m_port; 60 int m_port;
54 String m_path; 61 String m_path;
55 62
56 WildcardDisposition m_hostWildcard; 63 WildcardDisposition m_hostWildcard;
57 WildcardDisposition m_portWildcard; 64 WildcardDisposition m_portWildcard;
58 }; 65 };
59 66
60 } // namespace blink 67 } // namespace blink
61 68
62 #endif 69 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698