| 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 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 // It is an error to get the origin of an invalid URL. The result | 187 // It is an error to get the origin of an invalid URL. The result |
| 188 // will be the empty URL. | 188 // will be the empty URL. |
| 189 GURL GetOrigin() const; | 189 GURL GetOrigin() const; |
| 190 | 190 |
| 191 // A helper function to return a GURL stripped from the elements that are not | 191 // A helper function to return a GURL stripped from the elements that are not |
| 192 // supposed to be sent as HTTP referrer: username, password and ref fragment. | 192 // supposed to be sent as HTTP referrer: username, password and ref fragment. |
| 193 // For invalid URLs or URLs that no valid referrers, an empty URL will be | 193 // For invalid URLs or URLs that no valid referrers, an empty URL will be |
| 194 // returned. | 194 // returned. |
| 195 GURL GetAsReferrer() const; | 195 GURL GetAsReferrer() const; |
| 196 | 196 |
| 197 // Returns true if the scheme for the current URL is a known "standard" | 197 // Returns true if the scheme for the current URL is a known "standard-format" |
| 198 // scheme. Standard schemes have an authority and a path section. This | 198 // scheme. A standard-format scheme adheres to what RFC 3986 calls "generic |
| 199 // includes file: and filesystem:, which some callers may want to filter out | 199 // URI syntax" (https://tools.ietf.org/html/rfc3986#section-3). This includes |
| 200 // explicitly by calling SchemeIsFile[System]. | 200 // file: and filesystem:, which some callers may want to filter out explicitly |
| 201 // by calling SchemeIsFile[System]. |
| 201 bool IsStandard() const; | 202 bool IsStandard() const; |
| 202 | 203 |
| 203 // Returns true if the given parameter (should be lower-case ASCII to match | 204 // Returns true if the given parameter (should be lower-case ASCII to match |
| 204 // the canonicalized scheme) is the scheme for this URL. This call is more | 205 // the canonicalized scheme) is the scheme for this URL. This call is more |
| 205 // efficient than getting the scheme and comparing it because no copies or | 206 // efficient than getting the scheme and comparing it because no copies or |
| 206 // object constructions are done. | 207 // object constructions are done. |
| 207 bool SchemeIs(const char* lower_ascii_scheme) const; | 208 bool SchemeIs(const char* lower_ascii_scheme) const; |
| 208 | 209 |
| 209 // Returns true if the scheme is "http" or "https". | 210 // Returns true if the scheme is "http" or "https". |
| 210 bool SchemeIsHTTPOrHTTPS() const; | 211 bool SchemeIsHTTPOrHTTPS() const; |
| (...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 417 // Used for nested schemes [currently only filesystem:]. | 418 // Used for nested schemes [currently only filesystem:]. |
| 418 scoped_ptr<GURL> inner_url_; | 419 scoped_ptr<GURL> inner_url_; |
| 419 | 420 |
| 420 // TODO bug 684583: Add encoding for query params. | 421 // TODO bug 684583: Add encoding for query params. |
| 421 }; | 422 }; |
| 422 | 423 |
| 423 // Stream operator so GURL can be used in assertion statements. | 424 // Stream operator so GURL can be used in assertion statements. |
| 424 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 425 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 425 | 426 |
| 426 #endif // URL_GURL_H_ | 427 #endif // URL_GURL_H_ |
| OLD | NEW |