blob: 03ba14cbca308d7b66ceaf45ef873542cbf86c54 [file] [log] [blame]
[email protected]b9829df2013-11-18 22:03:511// 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
9namespace content {
10
11WebPublicSuffixListImpl::~WebPublicSuffixListImpl() {
12}
13
Blink Reformat1c4d759e2017-04-09 16:34:5414size_t WebPublicSuffixListImpl::GetPublicSuffixLength(
foolipf2903f442016-10-27 10:00:0215 const blink::WebString& host) {
brettw5a36380ef2016-10-27 19:51:5616 // 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 Reformat1c4d759e2017-04-09 16:34:5420 host.Utf8(),
brettw5a36380ef2016-10-27 19:51:5621 net::registry_controlled_domains::INCLUDE_UNKNOWN_REGISTRIES,
22 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES);
foolipf2903f442016-10-27 10:00:0223 return result ? result : host.length();
[email protected]b9829df2013-11-18 22:03:5124}
25
26} // namespace content