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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 bool SchemeIsFileSystem() const { | 229 bool SchemeIsFileSystem() const { |
230 return SchemeIs(url::kFileSystemScheme); | 230 return SchemeIs(url::kFileSystemScheme); |
231 } | 231 } |
232 | 232 |
233 // If the scheme indicates a secure connection | 233 // If the scheme indicates a secure connection |
234 bool SchemeIsSecure() const { | 234 bool SchemeIsSecure() const { |
235 return SchemeIs(url::kHttpsScheme) || SchemeIs(url::kWssScheme) || | 235 return SchemeIs(url::kHttpsScheme) || SchemeIs(url::kWssScheme) || |
236 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); | 236 (SchemeIsFileSystem() && inner_url() && inner_url()->SchemeIsSecure()); |
237 } | 237 } |
238 | 238 |
| 239 // Returns true if the scheme is "blob". |
| 240 bool SchemeIsBlob() const { |
| 241 return SchemeIs(url::kBlobScheme); |
| 242 } |
| 243 |
239 // The "content" of the URL is everything after the scheme (skipping the | 244 // The "content" of the URL is everything after the scheme (skipping the |
240 // scheme delimiting colon). It is an error to get the origin of an invalid | 245 // scheme delimiting colon). It is an error to get the origin of an invalid |
241 // URL. The result will be an empty string. | 246 // URL. The result will be an empty string. |
242 std::string GetContent() const; | 247 std::string GetContent() const; |
243 | 248 |
244 // Returns true if the hostname is an IP address. Note: this function isn't | 249 // Returns true if the hostname is an IP address. Note: this function isn't |
245 // as cheap as a simple getter because it re-parses the hostname to verify. | 250 // as cheap as a simple getter because it re-parses the hostname to verify. |
246 // This currently identifies only IPv4 addresses (bug 822685). | 251 // This currently identifies only IPv4 addresses (bug 822685). |
247 bool HostIsIPAddress() const; | 252 bool HostIsIPAddress() const; |
248 | 253 |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // Used for nested schemes [currently only filesystem:]. | 403 // Used for nested schemes [currently only filesystem:]. |
399 scoped_ptr<GURL> inner_url_; | 404 scoped_ptr<GURL> inner_url_; |
400 | 405 |
401 // TODO bug 684583: Add encoding for query params. | 406 // TODO bug 684583: Add encoding for query params. |
402 }; | 407 }; |
403 | 408 |
404 // Stream operator so GURL can be used in assertion statements. | 409 // Stream operator so GURL can be used in assertion statements. |
405 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 410 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
406 | 411 |
407 #endif // URL_GURL_H_ | 412 #endif // URL_GURL_H_ |
OLD | NEW |