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_GURL_H_ | 5 #ifndef URL_GURL_H_ |
6 #define URL_GURL_H_ | 6 #define URL_GURL_H_ |
7 | 7 |
8 #include <iosfwd> | 8 #include <iosfwd> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
216 bool SchemeIsFileSystem() const { | 216 bool SchemeIsFileSystem() const { |
217 return SchemeIs("filesystem"); | 217 return SchemeIs("filesystem"); |
218 } | 218 } |
219 | 219 |
220 // If the scheme indicates a secure connection | 220 // If the scheme indicates a secure connection |
221 bool SchemeIsSecure() const { | 221 bool SchemeIsSecure() const { |
222 return SchemeIs("https") || SchemeIs("wss") || | 222 return SchemeIs("https") || SchemeIs("wss") || |
223 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); | 223 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); |
224 } | 224 } |
225 | 225 |
226 // The "content" or the URL is everything after the scheme (skipping the | |
227 // scheme delimiting colon), or the entire URL if it has no scheme. | |
joth
2013/09/19 22:50:02
Probably safer as:
// The "content" or the URL is
Kristian Monsen
2013/09/20 05:57:31
Done.
| |
228 std::string GetContent() const { | |
229 return ComponentString(parsed_.GetContent()); | |
230 } | |
231 | |
226 // Returns true if the hostname is an IP address. Note: this function isn't | 232 // Returns true if the hostname is an IP address. Note: this function isn't |
227 // as cheap as a simple getter because it re-parses the hostname to verify. | 233 // as cheap as a simple getter because it re-parses the hostname to verify. |
228 // This currently identifies only IPv4 addresses (bug 822685). | 234 // This currently identifies only IPv4 addresses (bug 822685). |
229 bool HostIsIPAddress() const; | 235 bool HostIsIPAddress() const; |
230 | 236 |
231 // Getters for various components of the URL. The returned string will be | 237 // Getters for various components of the URL. The returned string will be |
232 // empty if the component is empty or is not present. | 238 // empty if the component is empty or is not present. |
233 std::string scheme() const { // Not including the colon. See also SchemeIs. | 239 std::string scheme() const { // Not including the colon. See also SchemeIs. |
234 return ComponentString(parsed_.scheme); | 240 return ComponentString(parsed_.scheme); |
235 } | 241 } |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
369 // Used for nested schemes [currently only filesystem:]. | 375 // Used for nested schemes [currently only filesystem:]. |
370 GURL* inner_url_; | 376 GURL* inner_url_; |
371 | 377 |
372 // TODO bug 684583: Add encoding for query params. | 378 // TODO bug 684583: Add encoding for query params. |
373 }; | 379 }; |
374 | 380 |
375 // Stream operator so GURL can be used in assertion statements. | 381 // Stream operator so GURL can be used in assertion statements. |
376 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 382 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
377 | 383 |
378 #endif // URL_GURL_H_ | 384 #endif // URL_GURL_H_ |
OLD | NEW |