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

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

Issue 2474903002: Part 3.1: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Simplyfying getSourceVector 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // algorithm at 42 // algorithm at
43 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list 43 // https://w3c.github.io/webappsec-csp/embedded/#subsume-source-list
44 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>, 44 static bool firstSubsumesSecond(HeapVector<Member<CSPSource>>,
45 HeapVector<Member<CSPSource>>); 45 HeapVector<Member<CSPSource>>);
46 46
47 DECLARE_TRACE(); 47 DECLARE_TRACE();
48 48
49 private: 49 private:
50 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar); 50 FRIEND_TEST_ALL_PREFIXES(CSPSourceTest, IsSimilar);
51 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources); 51 FRIEND_TEST_ALL_PREFIXES(SourceListDirectiveTest, GetIntersectCSPSources);
52 FRIEND_TEST_ALL_PREFIXES(CSPDirectiveListTest, GetSourceVector);
52 53
53 bool schemeMatches(const String&) const; 54 bool schemeMatches(const String&) const;
54 bool hostMatches(const String&) const; 55 bool hostMatches(const String&) const;
55 bool pathMatches(const String&) const; 56 bool pathMatches(const String&) const;
56 // Protocol is necessary to determine default port if it is zero. 57 // Protocol is necessary to determine default port if it is zero.
57 bool portMatches(int port, const String& protocol) const; 58 bool portMatches(int port, const String& protocol) const;
58 bool isSchemeOnly() const; 59 bool isSchemeOnly() const;
59 bool isSimilar(CSPSource* other); 60 bool isSimilar(CSPSource* other);
60 61
61 Member<ContentSecurityPolicy> m_policy; 62 Member<ContentSecurityPolicy> m_policy;
62 String m_scheme; 63 String m_scheme;
63 String m_host; 64 String m_host;
64 int m_port; 65 int m_port;
65 String m_path; 66 String m_path;
66 67
67 WildcardDisposition m_hostWildcard; 68 WildcardDisposition m_hostWildcard;
68 WildcardDisposition m_portWildcard; 69 WildcardDisposition m_portWildcard;
69 }; 70 };
70 71
71 } // namespace blink 72 } // namespace blink
72 73
73 #endif 74 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698