| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 // 'www.example.com' does not match an OriginAccessEntry for 'example.com' | 53 // 'www.example.com' does not match an OriginAccessEntry for 'example.com' |
| 54 DisallowSubdomains | 54 DisallowSubdomains |
| 55 }; | 55 }; |
| 56 | 56 |
| 57 enum MatchResult { | 57 enum MatchResult { |
| 58 MatchesOrigin, | 58 MatchesOrigin, |
| 59 MatchesOriginButIsPublicSuffix, | 59 MatchesOriginButIsPublicSuffix, |
| 60 DoesNotMatchOrigin | 60 DoesNotMatchOrigin |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 // If host is empty string and SubdomainSetting is not DisallowSubdomains, the
entry will match all domains in the specified protocol. | 63 // If host is empty string and SubdomainSetting is not DisallowSubdomains, the |
| 64 // IPv6 addresses must include brackets (e.g. '[2001:db8:85a3::8a2e:370:7334]'
, not '2001:db8:85a3::8a2e:370:7334'). | 64 // entry will match all domains in the specified protocol. |
| 65 // IPv6 addresses must include brackets (e.g. |
| 66 // '[2001:db8:85a3::8a2e:370:7334]', not '2001:db8:85a3::8a2e:370:7334'). |
| 65 OriginAccessEntry(const String& protocol, | 67 OriginAccessEntry(const String& protocol, |
| 66 const String& host, | 68 const String& host, |
| 67 SubdomainSetting); | 69 SubdomainSetting); |
| 68 | 70 |
| 69 // 'matchesOrigin' requires a protocol match (e.g. 'http' != 'https'). 'matche
sDomain' | 71 // 'matchesOrigin' requires a protocol match (e.g. 'http' != 'https'). |
| 70 // relaxes this constraint. | 72 // 'matchesDomain' relaxes this constraint. |
| 71 MatchResult matchesOrigin(const SecurityOrigin&) const; | 73 MatchResult matchesOrigin(const SecurityOrigin&) const; |
| 72 MatchResult matchesDomain(const SecurityOrigin&) const; | 74 MatchResult matchesDomain(const SecurityOrigin&) const; |
| 73 | 75 |
| 74 const String& protocol() const { return m_protocol; } | 76 const String& protocol() const { return m_protocol; } |
| 75 const String& host() const { return m_host; } | 77 const String& host() const { return m_host; } |
| 76 SubdomainSetting subdomainSettings() const { return m_subdomainSettings; } | 78 SubdomainSetting subdomainSettings() const { return m_subdomainSettings; } |
| 77 bool hostIsIPAddress() const { return m_hostIsIPAddress; } | 79 bool hostIsIPAddress() const { return m_hostIsIPAddress; } |
| 78 const String& registerable() const { return m_registerableDomain; } | 80 const String& registerable() const { return m_registerableDomain; } |
| 79 | 81 |
| 80 private: | 82 private: |
| (...skipping 13 matching lines...) Expand all Loading... |
| 94 } | 96 } |
| 95 | 97 |
| 96 PLATFORM_EXPORT inline bool operator!=(const OriginAccessEntry& a, | 98 PLATFORM_EXPORT inline bool operator!=(const OriginAccessEntry& a, |
| 97 const OriginAccessEntry& b) { | 99 const OriginAccessEntry& b) { |
| 98 return !(a == b); | 100 return !(a == b); |
| 99 } | 101 } |
| 100 | 102 |
| 101 } // namespace blink | 103 } // namespace blink |
| 102 | 104 |
| 103 #endif // OriginAccessEntry_h | 105 #endif // OriginAccessEntry_h |
| OLD | NEW |