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

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

Issue 2385533002: Replace usage of GURL(origin.Serialize()) with origin.GetURL() (Closed)
Patch Set: rebase and fix up some includes Created 4 years, 2 months 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
« ios/web/public/origin_util.mm ('K') | « ios/web/public/origin_util.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 if ((host1.len <= 0) || (host1.len != host2.len)) 212 if ((host1.len <= 0) || (host1.len != host2.len))
213 return false; 213 return false;
214 return !strncmp(gurl1.possibly_invalid_spec().data() + host1.begin, 214 return !strncmp(gurl1.possibly_invalid_spec().data() + host1.begin,
215 gurl2.possibly_invalid_spec().data() + host2.begin, 215 gurl2.possibly_invalid_spec().data() + host2.begin,
216 host1.len); 216 host1.len);
217 } 217 }
218 218
219 bool SameDomainOrHost(const url::Origin& origin1, 219 bool SameDomainOrHost(const url::Origin& origin1,
220 const url::Origin& origin2, 220 const url::Origin& origin2,
221 PrivateRegistryFilter filter) { 221 PrivateRegistryFilter filter) {
222 return SameDomainOrHost(GURL(origin1.Serialize()), GURL(origin2.Serialize()), 222 return SameDomainOrHost(origin1.GetURL(), origin2.GetURL(), filter);
223 filter);
224 } 223 }
225 224
226 size_t GetRegistryLength( 225 size_t GetRegistryLength(
227 const GURL& gurl, 226 const GURL& gurl,
228 UnknownRegistryFilter unknown_filter, 227 UnknownRegistryFilter unknown_filter,
229 PrivateRegistryFilter private_filter) { 228 PrivateRegistryFilter private_filter) {
230 base::StringPiece host = gurl.host_piece(); 229 base::StringPiece host = gurl.host_piece();
231 if (host.empty()) 230 if (host.empty())
232 return std::string::npos; 231 return std::string::npos;
233 if (gurl.HostIsIPAddress()) 232 if (gurl.HostIsIPAddress())
(...skipping 20 matching lines...) Expand all
254 253
255 void SetFindDomainGraph(const unsigned char* domains, size_t length) { 254 void SetFindDomainGraph(const unsigned char* domains, size_t length) {
256 CHECK(domains); 255 CHECK(domains);
257 CHECK_NE(length, 0u); 256 CHECK_NE(length, 0u);
258 g_graph = domains; 257 g_graph = domains;
259 g_graph_length = length; 258 g_graph_length = length;
260 } 259 }
261 260
262 } // namespace registry_controlled_domains 261 } // namespace registry_controlled_domains
263 } // namespace net 262 } // namespace net
OLDNEW
« ios/web/public/origin_util.mm ('K') | « ios/web/public/origin_util.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698