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

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

Issue 2442513004: Part 1.1: Is policy list subsumed under subsuming policy? (Closed)
Patch Set: Changing comment 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/csp/CSPSource.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 14 matching lines...) Expand all
25 const String& scheme, 25 const String& scheme,
26 const String& host, 26 const String& host,
27 int port, 27 int port,
28 const String& path, 28 const String& path,
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 // Returns true if this CSPSource subsumes the other, as defined by the
36 // algorithm at https://w3c.github.io/webappsec-csp/embedded/#subsume-policy
37 bool subsumes(CSPSource*);
38
35 DECLARE_TRACE(); 39 DECLARE_TRACE();
36 40
37 private: 41 private:
38 bool schemeMatches(const String&) const; 42 bool schemeMatches(const String&) const;
39 bool hostMatches(const String&) const; 43 bool hostMatches(const String&) const;
40 bool pathMatches(const String&) const; 44 bool pathMatches(const String&) const;
41 // Protocol is necessary to determine default port if it is zero. 45 // Protocol is necessary to determine default port if it is zero.
42 bool portMatches(int port, const String& protocol) const; 46 bool portMatches(int port, const String& protocol) const;
43 bool isSchemeOnly() const; 47 bool isSchemeOnly() const;
44 48
45 Member<ContentSecurityPolicy> m_policy; 49 Member<ContentSecurityPolicy> m_policy;
46 String m_scheme; 50 String m_scheme;
47 String m_host; 51 String m_host;
48 int m_port; 52 int m_port;
49 String m_path; 53 String m_path;
50 54
51 WildcardDisposition m_hostWildcard; 55 WildcardDisposition m_hostWildcard;
52 WildcardDisposition m_portWildcard; 56 WildcardDisposition m_portWildcard;
53 }; 57 };
54 58
55 } // namespace blink 59 } // namespace blink
56 60
57 #endif 61 #endif
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/frame/csp/CSPSource.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698