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

Side by Side Diff: third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.h

Issue 1607243002: Add 'OriginAccessEntry::matchDomain'. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2623
Patch Set: Created 4 years, 11 months 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 /* 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 55
56 enum MatchResult { 56 enum MatchResult {
57 MatchesOrigin, 57 MatchesOrigin,
58 MatchesOriginButIsPublicSuffix, 58 MatchesOriginButIsPublicSuffix,
59 DoesNotMatchOrigin 59 DoesNotMatchOrigin
60 }; 60 };
61 61
62 // If host is empty string and SubdomainSetting is not DisallowSubdomains, t he entry will match all domains in the specified protocol. 62 // If host is empty string and SubdomainSetting is not DisallowSubdomains, t he entry will match all domains in the specified protocol.
63 // IPv6 addresses must include brackets (e.g. '[2001:db8:85a3::8a2e:370:7334 ]', not '2001:db8:85a3::8a2e:370:7334'). 63 // IPv6 addresses must include brackets (e.g. '[2001:db8:85a3::8a2e:370:7334 ]', not '2001:db8:85a3::8a2e:370:7334').
64 OriginAccessEntry(const String& protocol, const String& host, SubdomainSetti ng); 64 OriginAccessEntry(const String& protocol, const String& host, SubdomainSetti ng);
65
66 // 'matchesOrigin' requires a protocol match (e.g. 'http' != 'https'). 'matc hesDomain'
67 // relaxes this constraint.
65 MatchResult matchesOrigin(const SecurityOrigin&) const; 68 MatchResult matchesOrigin(const SecurityOrigin&) const;
69 MatchResult matchesDomain(const SecurityOrigin&) const;
66 70
67 const String& protocol() const { return m_protocol; } 71 const String& protocol() const { return m_protocol; }
68 const String& host() const { return m_host; } 72 const String& host() const { return m_host; }
69 SubdomainSetting subdomainSettings() const { return m_subdomainSettings; } 73 SubdomainSetting subdomainSettings() const { return m_subdomainSettings; }
70 bool hostIsIPAddress() const { return m_hostIsIPAddress; } 74 bool hostIsIPAddress() const { return m_hostIsIPAddress; }
71 const String& registerable() const { return m_registerableDomain; } 75 const String& registerable() const { return m_registerableDomain; }
72 76
73 private: 77 private:
74 String m_protocol; 78 String m_protocol;
75 String m_host; 79 String m_host;
(...skipping 11 matching lines...) Expand all
87 } 91 }
88 92
89 PLATFORM_EXPORT inline bool operator!=(const OriginAccessEntry& a, const OriginA ccessEntry& b) 93 PLATFORM_EXPORT inline bool operator!=(const OriginAccessEntry& a, const OriginA ccessEntry& b)
90 { 94 {
91 return !(a == b); 95 return !(a == b);
92 } 96 }
93 97
94 } // namespace blink 98 } // namespace blink
95 99
96 #endif // OriginAccessEntry_h 100 #endif // OriginAccessEntry_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/Document.cpp ('k') | third_party/WebKit/Source/platform/weborigin/OriginAccessEntry.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698