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.cpp) | 7 // (netwerk/dns/src/nsEffectiveTLDService.cpp) |
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 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
358 return SameDomainOrHost(origin1.host(), origin2.host(), filter); | 358 return SameDomainOrHost(origin1.host(), origin2.host(), filter); |
359 } | 359 } |
360 | 360 |
361 bool SameDomainOrHost(const url::Origin& origin1, | 361 bool SameDomainOrHost(const url::Origin& origin1, |
362 const base::Optional<url::Origin>& origin2, | 362 const base::Optional<url::Origin>& origin2, |
363 PrivateRegistryFilter filter) { | 363 PrivateRegistryFilter filter) { |
364 return origin2.has_value() && | 364 return origin2.has_value() && |
365 SameDomainOrHost(origin1, origin2.value(), filter); | 365 SameDomainOrHost(origin1, origin2.value(), filter); |
366 } | 366 } |
367 | 367 |
| 368 bool SameDomainOrHost(const GURL& gurl, |
| 369 const url::Origin& origin, |
| 370 PrivateRegistryFilter filter) { |
| 371 return SameDomainOrHost(gurl.host_piece(), origin.host(), filter); |
| 372 } |
| 373 |
368 size_t GetRegistryLength( | 374 size_t GetRegistryLength( |
369 const GURL& gurl, | 375 const GURL& gurl, |
370 UnknownRegistryFilter unknown_filter, | 376 UnknownRegistryFilter unknown_filter, |
371 PrivateRegistryFilter private_filter) { | 377 PrivateRegistryFilter private_filter) { |
372 return GetRegistryLengthImpl(gurl.host_piece(), unknown_filter, | 378 return GetRegistryLengthImpl(gurl.host_piece(), unknown_filter, |
373 private_filter); | 379 private_filter); |
374 } | 380 } |
375 | 381 |
376 bool HostHasRegistryControlledDomain(base::StringPiece host, | 382 bool HostHasRegistryControlledDomain(base::StringPiece host, |
377 UnknownRegistryFilter unknown_filter, | 383 UnknownRegistryFilter unknown_filter, |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 | 441 |
436 void SetFindDomainGraph(const unsigned char* domains, size_t length) { | 442 void SetFindDomainGraph(const unsigned char* domains, size_t length) { |
437 CHECK(domains); | 443 CHECK(domains); |
438 CHECK_NE(length, 0u); | 444 CHECK_NE(length, 0u); |
439 g_graph = domains; | 445 g_graph = domains; |
440 g_graph_length = length; | 446 g_graph_length = length; |
441 } | 447 } |
442 | 448 |
443 } // namespace registry_controlled_domains | 449 } // namespace registry_controlled_domains |
444 } // namespace net | 450 } // namespace net |
OLD | NEW |