| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 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 #include "content/renderer/webpublicsuffixlist_impl.h" | 5 #include "content/renderer/webpublicsuffixlist_impl.h" |
| 6 | 6 |
| 7 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 7 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 8 | 8 |
| 9 namespace content { | 9 namespace content { |
| 10 | 10 |
| 11 WebPublicSuffixListImpl::~WebPublicSuffixListImpl() { | 11 WebPublicSuffixListImpl::~WebPublicSuffixListImpl() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 size_t WebPublicSuffixListImpl::getPublicSuffixLength( | 14 size_t WebPublicSuffixListImpl::getPublicSuffixLength( |
| 15 const blink::WebString& host) { | 15 const blink::WebString& host) { |
| 16 size_t result = net::registry_controlled_domains::GetRegistryLength( | 16 // Blink passes some things that aren't technically hosts like "*.foo", so |
| 17 host.utf8(), | 17 // use the permissive variant. |
| 18 net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES, | 18 size_t result = |
| 19 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); | 19 net::registry_controlled_domains::PermissiveGetHostRegistryLength( |
| 20 host.utf8(), |
| 21 net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES, |
| 22 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| 20 return result ? result : host.length(); | 23 return result ? result : host.length(); |
| 21 } | 24 } |
| 22 | 25 |
| 23 } // namespace content | 26 } // namespace content |
| OLD | NEW |