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

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

Issue 2452903004: Part 2.2: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: After rebasing on part2.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 20 matching lines...) Expand all
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 // Returns true if this CSPSource subsumes the other, as defined by the 35 // Returns true if this CSPSource subsumes the other, as defined by the
36 // algorithm at https://w3c.github.io/webappsec-csp/embedded/#subsume-policy 36 // algorithm at https://w3c.github.io/webappsec-csp/embedded/#subsume-policy
37 bool subsumes(CSPSource*); 37 bool subsumes(CSPSource*);
38 // Retrieve the most restrictive information from the two CSPSources if 38 // Retrieve the most restrictive information from the two CSPSources if
39 // isSimilar is true for the two. Otherwise, return nullptr. 39 // isSimilar is true for the two. Otherwise, return nullptr.
40 CSPSource* intersect(CSPSource*); 40 CSPSource* intersect(CSPSource*);
41 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>,
Mike West 2016/11/10 15:04:54 Why not just `std::vector<CSPSource*>`? Also, ple
42 HeapVector<Member<CSPSource>>);
41 43
42 DECLARE_TRACE(); 44 DECLARE_TRACE();
43 45
44 private: 46 private:
45 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); 47 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar);
46 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); 48 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources);
47 49
48 bool schemeMatches(const String&) const; 50 bool schemeMatches(const String&) const;
49 bool hostMatches(const String&) const; 51 bool hostMatches(const String&) const;
50 bool pathMatches(const String&) const; 52 bool pathMatches(const String&) const;
51 // Protocol is necessary to determine default port if it is zero. 53 // Protocol is necessary to determine default port if it is zero.
52 bool portMatches(int port, const String& protocol) const; 54 bool portMatches(int port, const String& protocol) const;
53 bool isSchemeOnly() const; 55 bool isSchemeOnly() const;
54 bool isSimilar(CSPSource* other); 56 bool isSimilar(CSPSource* other);
55 57
56 Member<ContentSecurityPolicy> m_policy; 58 Member<ContentSecurityPolicy> m_policy;
57 String m_scheme; 59 String m_scheme;
58 String m_host; 60 String m_host;
59 int m_port; 61 int m_port;
60 String m_path; 62 String m_path;
61 63
62 WildcardDisposition m_hostWildcard; 64 WildcardDisposition m_hostWildcard;
63 WildcardDisposition m_portWildcard; 65 WildcardDisposition m_portWildcard;
64 }; 66 };
65 67
66 } // namespace blink 68 } // namespace blink
67 69
68 #endif 70 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698