| OLD | NEW |
| 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 "wtf/text/WTFString.h" | 8 #include "wtf/text/WTFString.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 class ContentSecurityPolicy; | 12 class ContentSecurityPolicy; |
| 13 class KURL; | 13 class KURL; |
| 14 | 14 |
| 15 class CSPSource { | 15 class CSPSource { |
| 16 public: | 16 public: |
| 17 enum WildcardDisposition { | 17 CSPSource(ContentSecurityPolicy*, const String& scheme, const String& host,
int port, const String& path, bool hostHasWildcard, bool portHasWildcard); |
| 18 HasWildcard, | |
| 19 NoWildcard | |
| 20 }; | |
| 21 | |
| 22 CSPSource(ContentSecurityPolicy*, const String& scheme, const String& host,
int port, const String& path, WildcardDisposition hostWildcard, WildcardDisposit
ion portWildcard); | |
| 23 bool matches(const KURL&) const; | 18 bool matches(const KURL&) const; |
| 24 | 19 |
| 25 private: | 20 private: |
| 26 bool schemeMatches(const KURL&) const; | 21 bool schemeMatches(const KURL&) const; |
| 27 bool hostMatches(const KURL&) const; | 22 bool hostMatches(const KURL&) const; |
| 28 bool pathMatches(const KURL&) const; | 23 bool pathMatches(const KURL&) const; |
| 29 bool portMatches(const KURL&) const; | 24 bool portMatches(const KURL&) const; |
| 30 bool isSchemeOnly() const; | 25 bool isSchemeOnly() const; |
| 31 | 26 |
| 32 ContentSecurityPolicy* m_policy; | 27 ContentSecurityPolicy* m_policy; |
| 33 String m_scheme; | 28 String m_scheme; |
| 34 String m_host; | 29 String m_host; |
| 35 int m_port; | 30 int m_port; |
| 36 String m_path; | 31 String m_path; |
| 37 | 32 |
| 38 WildcardDisposition m_hostWildcard; | 33 bool m_hostHasWildcard; |
| 39 WildcardDisposition m_portWildcard; | 34 bool m_portHasWildcard; |
| 40 }; | 35 }; |
| 41 | 36 |
| 42 } // namespace | 37 } // namespace |
| 43 | 38 |
| 44 #endif | 39 #endif |
| OLD | NEW |