Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(7)

Side by Side Diff: net/base/registry_controlled_domains/registry_controlled_domain.cc

Issue 2405483002: Make the request initiator Optional (Closed)
Patch Set: Addressed comments + rebase Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 336 matching lines...) Expand 10 before | Expand all | Expand 10 after
347 gurl2.possibly_invalid_spec().data() + host2.begin, 347 gurl2.possibly_invalid_spec().data() + host2.begin,
348 host1.len); 348 host1.len);
349 } 349 }
350 350
351 bool SameDomainOrHost(const url::Origin& origin1, 351 bool SameDomainOrHost(const url::Origin& origin1,
352 const url::Origin& origin2, 352 const url::Origin& origin2,
353 PrivateRegistryFilter filter) { 353 PrivateRegistryFilter filter) {
354 return SameDomainOrHost(origin1.GetURL(), origin2.GetURL(), filter); 354 return SameDomainOrHost(origin1.GetURL(), origin2.GetURL(), filter);
355 } 355 }
356 356
357 bool SameDomainOrHost(const url::Origin& origin1,
358 const base::Optional<url::Origin>& origin2,
359 PrivateRegistryFilter filter) {
360 if (!origin2.has_value())
361 return false;
362 return SameDomainOrHost(origin1, origin2.value(), filter);
363 }
364
357 size_t GetRegistryLength( 365 size_t GetRegistryLength(
358 const GURL& gurl, 366 const GURL& gurl,
359 UnknownRegistryFilter unknown_filter, 367 UnknownRegistryFilter unknown_filter,
360 PrivateRegistryFilter private_filter) { 368 PrivateRegistryFilter private_filter) {
361 return GetRegistryLengthImpl(gurl.host_piece(), unknown_filter, 369 return GetRegistryLengthImpl(gurl.host_piece(), unknown_filter,
362 private_filter); 370 private_filter);
363 } 371 }
364 372
365 bool HostHasRegistryControlledDomain(base::StringPiece host, 373 bool HostHasRegistryControlledDomain(base::StringPiece host,
366 UnknownRegistryFilter unknown_filter, 374 UnknownRegistryFilter unknown_filter,
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 432
425 void SetFindDomainGraph(const unsigned char* domains, size_t length) { 433 void SetFindDomainGraph(const unsigned char* domains, size_t length) {
426 CHECK(domains); 434 CHECK(domains);
427 CHECK_NE(length, 0u); 435 CHECK_NE(length, 0u);
428 g_graph = domains; 436 g_graph = domains;
429 g_graph_length = length; 437 g_graph_length = length;
430 } 438 }
431 439
432 } // namespace registry_controlled_domains 440 } // namespace registry_controlled_domains
433 } // namespace net 441 } // namespace net
OLDNEW
« no previous file with comments | « net/base/registry_controlled_domains/registry_controlled_domain.h ('k') | net/url_request/test_url_fetcher_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698