OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // NB: Modelled after Mozilla's code (originally written by Pamela Greene, | 5 // NB: Modelled after Mozilla's code (originally written by Pamela Greene, |
6 // later modified by others), but almost entirely rewritten for Chrome. | 6 // later modified by others), but almost entirely rewritten for Chrome. |
7 // (netwerk/dns/src/nsEffectiveTLDService.h) | 7 // (netwerk/dns/src/nsEffectiveTLDService.h) |
8 /* ***** BEGIN LICENSE BLOCK ***** | 8 /* ***** BEGIN LICENSE BLOCK ***** |
9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 | 9 * Version: MPL 1.1/GPL 2.0/LGPL 2.1 |
10 * | 10 * |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
128 // This enum is a required parameter to all public methods declared for this | 128 // This enum is a required parameter to all public methods declared for this |
129 // service. The Public Suffix List (http://publicsuffix.org/) this service | 129 // service. The Public Suffix List (http://publicsuffix.org/) this service |
130 // uses as a data source splits all effective-TLDs into two groups. The main | 130 // uses as a data source splits all effective-TLDs into two groups. The main |
131 // group describes registries that are acknowledged by ICANN. The second group | 131 // group describes registries that are acknowledged by ICANN. The second group |
132 // contains a list of private additions for domains that enable external users | 132 // contains a list of private additions for domains that enable external users |
133 // to create subdomains, such as appspot.com. | 133 // to create subdomains, such as appspot.com. |
134 // The RegistryFilter enum lets you choose whether you want to include the | 134 // The RegistryFilter enum lets you choose whether you want to include the |
135 // private additions in your lookup. | 135 // private additions in your lookup. |
136 // See this for example use cases: | 136 // See this for example use cases: |
137 // https://wiki.mozilla.org/Public_Suffix_List/Use_Cases | 137 // https://wiki.mozilla.org/Public_Suffix_List/Use_Cases |
138 enum NET_EXPORT PrivateRegistryFilter { | 138 enum PrivateRegistryFilter { |
139 EXCLUDE_PRIVATE_REGISTRIES = 0, | 139 EXCLUDE_PRIVATE_REGISTRIES = 0, |
140 INCLUDE_PRIVATE_REGISTRIES | 140 INCLUDE_PRIVATE_REGISTRIES |
141 }; | 141 }; |
142 | 142 |
143 // This enum is a required parameter to the GetRegistryLength functions | 143 // This enum is a required parameter to the GetRegistryLength functions |
144 // declared for this service. Whenever there is no matching rule in the | 144 // declared for this service. Whenever there is no matching rule in the |
145 // effective-TLD data (or in the default data, if the resource failed to | 145 // effective-TLD data (or in the default data, if the resource failed to |
146 // load), the result will be dependent on which enum value was passed in. | 146 // load), the result will be dependent on which enum value was passed in. |
147 // If EXCLUDE_UNKNOWN_REGISTRIES was passed in, the resulting registry length | 147 // If EXCLUDE_UNKNOWN_REGISTRIES was passed in, the resulting registry length |
148 // will be 0. If INCLUDE_UNKNOWN_REGISTRIES was passed in, the resulting | 148 // will be 0. If INCLUDE_UNKNOWN_REGISTRIES was passed in, the resulting |
149 // registry length will be the length of the last subcomponent (eg. 3 for | 149 // registry length will be the length of the last subcomponent (eg. 3 for |
150 // foobar.baz). | 150 // foobar.baz). |
151 enum NET_EXPORT UnknownRegistryFilter { | 151 enum UnknownRegistryFilter { |
152 EXCLUDE_UNKNOWN_REGISTRIES = 0, | 152 EXCLUDE_UNKNOWN_REGISTRIES = 0, |
153 INCLUDE_UNKNOWN_REGISTRIES | 153 INCLUDE_UNKNOWN_REGISTRIES |
154 }; | 154 }; |
155 | 155 |
156 // Returns the registered, organization-identifying host and all its registry | 156 // Returns the registered, organization-identifying host and all its registry |
157 // information, but no subdomains, from the given GURL. Returns an empty | 157 // information, but no subdomains, from the given GURL. Returns an empty |
158 // string if the GURL is invalid, has no host (e.g. a file: URL), has multiple | 158 // string if the GURL is invalid, has no host (e.g. a file: URL), has multiple |
159 // trailing dots, is an IP address, has only one subcomponent (i.e. no dots | 159 // trailing dots, is an IP address, has only one subcomponent (i.e. no dots |
160 // other than leading/trailing ones), or is itself a recognized registry | 160 // other than leading/trailing ones), or is itself a recognized registry |
161 // identifier. If no matching rule is found in the effective-TLD data (or in | 161 // identifier. If no matching rule is found in the effective-TLD data (or in |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 // Used for unit tests. Use default domains. | 229 // Used for unit tests. Use default domains. |
230 NET_EXPORT_PRIVATE void SetFindDomainGraph(); | 230 NET_EXPORT_PRIVATE void SetFindDomainGraph(); |
231 | 231 |
232 // Used for unit tests, so that a frozen list of domains is used. | 232 // Used for unit tests, so that a frozen list of domains is used. |
233 NET_EXPORT_PRIVATE void SetFindDomainGraph(const unsigned char* domains, | 233 NET_EXPORT_PRIVATE void SetFindDomainGraph(const unsigned char* domains, |
234 size_t length); | 234 size_t length); |
235 } // namespace registry_controlled_domains | 235 } // namespace registry_controlled_domains |
236 } // namespace net | 236 } // namespace net |
237 | 237 |
238 #endif // NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_ | 238 #endif // NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_ |
OLD | NEW |