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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 PrivateRegistryFilter private_filter); | 219 PrivateRegistryFilter private_filter); |
220 | 220 |
221 // Like the GURL version, but takes a host (which is canonicalized internally) | 221 // Like the GURL version, but takes a host (which is canonicalized internally) |
222 // instead of a full GURL. | 222 // instead of a full GURL. |
223 NET_EXPORT size_t GetRegistryLength(const std::string& host, | 223 NET_EXPORT size_t GetRegistryLength(const std::string& host, |
224 UnknownRegistryFilter unknown_filter, | 224 UnknownRegistryFilter unknown_filter, |
225 PrivateRegistryFilter private_filter); | 225 PrivateRegistryFilter private_filter); |
226 | 226 |
227 typedef const struct DomainRule* (*FindDomainPtr)(const char *, unsigned int); | 227 typedef const struct DomainRule* (*FindDomainPtr)(const char *, unsigned int); |
228 | 228 |
229 // Used for unit tests, so that a different perfect hash map from the full | 229 // Used for unit tests. Use default domains. |
230 // list is used. Set to NULL to use the Default function. | 230 NET_EXPORT_PRIVATE void SetFindDomainGraph(); |
231 NET_EXPORT_PRIVATE void SetFindDomainFunctionAndStringPoolForTesting( | |
232 FindDomainPtr fn, const char* stringpool); | |
233 | 231 |
| 232 // Used for unit tests, so that a frozen list of domains is used. |
| 233 NET_EXPORT_PRIVATE void SetFindDomainGraph(const unsigned char* domains, |
| 234 size_t length); |
234 } // namespace registry_controlled_domains | 235 } // namespace registry_controlled_domains |
235 } // namespace net | 236 } // namespace net |
236 | 237 |
237 #endif // NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_ | 238 #endif // NET_BASE_REGISTRY_CONTROLLED_DOMAINS_REGISTRY_CONTROLLED_DOMAIN_H_ |
OLD | NEW |