[email protected] | b9829df | 2013-11-18 22:03:51 | [diff] [blame] | 1 | // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "content/renderer/webpublicsuffixlist_impl.h" |
| 6 | |
| 7 | #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 8 | |
| 9 | namespace content { |
| 10 | |
| 11 | WebPublicSuffixListImpl::~WebPublicSuffixListImpl() { |
| 12 | } |
| 13 | |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 14 | size_t WebPublicSuffixListImpl::GetPublicSuffixLength( |
foolip | f2903f44 | 2016-10-27 10:00:02 | [diff] [blame] | 15 | const blink::WebString& host) { |
brettw | 5a36380ef | 2016-10-27 19:51:56 | [diff] [blame] | 16 | // Blink passes some things that aren't technically hosts like "*.foo", so |
| 17 | // use the permissive variant. |
| 18 | size_t result = |
| 19 | net::registry_controlled_domains::PermissiveGetHostRegistryLength( |
Blink Reformat | 1c4d759e | 2017-04-09 16:34:54 | [diff] [blame] | 20 | host.Utf8(), |
brettw | 5a36380ef | 2016-10-27 19:51:56 | [diff] [blame] | 21 | net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES, |
| 22 | net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
foolip | f2903f44 | 2016-10-27 10:00:02 | [diff] [blame] | 23 | return result ? result : host.length(); |
[email protected] | b9829df | 2013-11-18 22:03:51 | [diff] [blame] | 24 | } |
| 25 | |
| 26 | } // namespace content |