 Chromium Code Reviews
 Chromium Code Reviews Issue 2562813003:
  Merge logic for SameDomainOrHost for GURLs and Origins  (Closed)
    
  
    Issue 2562813003:
  Merge logic for SameDomainOrHost for GURLs and Origins  (Closed) 
  | OLD | NEW | 
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef URL_URL_UTIL_H_ | 5 #ifndef URL_URL_UTIL_H_ | 
| 6 #define URL_URL_UTIL_H_ | 6 #define URL_URL_UTIL_H_ | 
| 7 | 7 | 
| 8 #include <string> | 8 #include <string> | 
| 9 | 9 | 
| 10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" | 
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 139 // the given |lower_ascii_domain| string. For example, if the canonicalized | 139 // the given |lower_ascii_domain| string. For example, if the canonicalized | 
| 140 // hostname is "www.google.com", this will return true for "com", "google.com", | 140 // hostname is "www.google.com", this will return true for "com", "google.com", | 
| 141 // and "www.google.com" domains. | 141 // and "www.google.com" domains. | 
| 142 // | 142 // | 
| 143 // If either of the input StringPieces is empty, the return value is false. The | 143 // If either of the input StringPieces is empty, the return value is false. The | 
| 144 // input domain should be a lower-case ASCII string in order to match the | 144 // input domain should be a lower-case ASCII string in order to match the | 
| 145 // canonicalized host. | 145 // canonicalized host. | 
| 146 URL_EXPORT bool DomainIs(base::StringPiece canonicalized_host, | 146 URL_EXPORT bool DomainIs(base::StringPiece canonicalized_host, | 
| 147 base::StringPiece lower_ascii_domain); | 147 base::StringPiece lower_ascii_domain); | 
| 148 | 148 | 
| 149 // Hosts ----------------------------------------------------------------------- | |
| 
brettw
2016/12/15 18:45:32
I'm not sure these section headers are helping muc
 
Charlie Harrison
2016/12/16 22:48:32
Done.
 | |
| 150 | |
| 151 // Returns true if the hostname is an IP address. Note: this function isn't very | |
| 152 // cheap, as it must re-parse the host to verify. | |
| 153 URL_EXPORT bool HostIsIPAddress(base::StringPiece host); | |
| 154 | |
| 149 // URL library wrappers -------------------------------------------------------- | 155 // URL library wrappers -------------------------------------------------------- | 
| 150 | 156 | 
| 151 // Parses the given spec according to the extracted scheme type. Normal users | 157 // Parses the given spec according to the extracted scheme type. Normal users | 
| 152 // should use the URL object, although this may be useful if performance is | 158 // should use the URL object, although this may be useful if performance is | 
| 153 // critical and you don't want to do the heap allocation for the std::string. | 159 // critical and you don't want to do the heap allocation for the std::string. | 
| 154 // | 160 // | 
| 155 // As with the Canonicalize* functions, the charset converter can | 161 // As with the Canonicalize* functions, the charset converter can | 
| 156 // be NULL to use UTF-8 (it will be faster in this case). | 162 // be NULL to use UTF-8 (it will be faster in this case). | 
| 157 // | 163 // | 
| 158 // Returns true if a valid URL was produced, false if not. On failure, the | 164 // Returns true if a valid URL was produced, false if not. On failure, the | 
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 227 | 233 | 
| 228 // Escapes the given string as defined by the JS method encodeURIComponent. See | 234 // Escapes the given string as defined by the JS method encodeURIComponent. See | 
| 229 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent | 235 // https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/encodeUR IComponent | 
| 230 URL_EXPORT void EncodeURIComponent(const char* input, | 236 URL_EXPORT void EncodeURIComponent(const char* input, | 
| 231 int length, | 237 int length, | 
| 232 CanonOutput* output); | 238 CanonOutput* output); | 
| 233 | 239 | 
| 234 } // namespace url | 240 } // namespace url | 
| 235 | 241 | 
| 236 #endif // URL_URL_UTIL_H_ | 242 #endif // URL_URL_UTIL_H_ | 
| OLD | NEW |