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 25 matching lines...) Expand all Loading... |
36 * of those above. If you wish to allow use of your version of this file only | 36 * of those above. If you wish to allow use of your version of this file only |
37 * under the terms of either the GPL or the LGPL, and not to allow others to | 37 * under the terms of either the GPL or the LGPL, and not to allow others to |
38 * use your version of this file under the terms of the MPL, indicate your | 38 * use your version of this file under the terms of the MPL, indicate your |
39 * decision by deleting the provisions above and replace them with the notice | 39 * decision by deleting the provisions above and replace them with the notice |
40 * and other provisions required by the GPL or the LGPL. If you do not delete | 40 * and other provisions required by the GPL or the LGPL. If you do not delete |
41 * the provisions above, a recipient may use your version of this file under | 41 * the provisions above, a recipient may use your version of this file under |
42 * the terms of any one of the MPL, the GPL or the LGPL. | 42 * the terms of any one of the MPL, the GPL or the LGPL. |
43 * | 43 * |
44 * ***** END LICENSE BLOCK ***** */ | 44 * ***** END LICENSE BLOCK ***** */ |
45 | 45 |
46 #include "net/base/registry_controlled_domain.h" | 46 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
47 | 47 |
48 #include "base/logging.h" | 48 #include "base/logging.h" |
49 #include "base/string_util.h" | 49 #include "base/string_util.h" |
50 #include "base/utf_string_conversions.h" | 50 #include "base/utf_string_conversions.h" |
51 #include "googleurl/src/gurl.h" | 51 #include "googleurl/src/gurl.h" |
52 #include "googleurl/src/url_parse.h" | 52 #include "googleurl/src/url_parse.h" |
53 #include "net/base/net_module.h" | 53 #include "net/base/net_module.h" |
54 #include "net/base/net_util.h" | 54 #include "net/base/net_util.h" |
55 | 55 |
56 #include "effective_tld_names.cc" | 56 #include "effective_tld_names.cc" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
245 next_dot = host.find('.', curr_start); | 245 next_dot = host.find('.', curr_start); |
246 } | 246 } |
247 | 247 |
248 // No rule found in the registry. curr_start now points to the first | 248 // No rule found in the registry. curr_start now points to the first |
249 // character of the last subcomponent of the host, so if we allow unknown | 249 // character of the last subcomponent of the host, so if we allow unknown |
250 // registries, return the length of this subcomponent. | 250 // registries, return the length of this subcomponent. |
251 return allow_unknown_registries ? (host.length() - curr_start) : 0; | 251 return allow_unknown_registries ? (host.length() - curr_start) : 0; |
252 } | 252 } |
253 | 253 |
254 } // namespace net | 254 } // namespace net |
OLD | NEW |