| 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 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 // this URL is not a standard URL, then the result will be an empty, | 191 // this URL is not a standard URL, then the result will be an empty, |
| 192 // invalid GURL. If the URL has neither username nor password, this | 192 // invalid GURL. If the URL has neither username nor password, this |
| 193 // degenerates to GetWithEmptyPath(). | 193 // degenerates to GetWithEmptyPath(). |
| 194 // | 194 // |
| 195 // It is an error to get the origin of an invalid URL. The result | 195 // It is an error to get the origin of an invalid URL. The result |
| 196 // will be the empty URL. | 196 // will be the empty URL. |
| 197 GURL GetOrigin() const; | 197 GURL GetOrigin() const; |
| 198 | 198 |
| 199 // A helper function to return a GURL stripped from the elements that are not | 199 // A helper function to return a GURL stripped from the elements that are not |
| 200 // supposed to be sent as HTTP referrer: username, password and ref fragment. | 200 // supposed to be sent as HTTP referrer: username, password and ref fragment. |
| 201 // For invalid URLs the original URL will be returned. | 201 // For invalid URLs or URLs that no valid referrers, an empty URL will be |
| 202 // returned. |
| 202 GURL GetAsReferrer() const; | 203 GURL GetAsReferrer() const; |
| 203 | 204 |
| 204 // Returns true if the scheme for the current URL is a known "standard" | 205 // Returns true if the scheme for the current URL is a known "standard" |
| 205 // scheme. Standard schemes have an authority and a path section. This | 206 // scheme. Standard schemes have an authority and a path section. This |
| 206 // includes file: and filesystem:, which some callers may want to filter out | 207 // includes file: and filesystem:, which some callers may want to filter out |
| 207 // explicitly by calling SchemeIsFile[System]. | 208 // explicitly by calling SchemeIsFile[System]. |
| 208 bool IsStandard() const; | 209 bool IsStandard() const; |
| 209 | 210 |
| 210 // Returns true if the given parameter (should be lower-case ASCII to match | 211 // Returns true if the given parameter (should be lower-case ASCII to match |
| 211 // the canonicalized scheme) is the scheme for this URL. This call is more | 212 // the canonicalized scheme) is the scheme for this URL. This call is more |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 // Used for nested schemes [currently only filesystem:]. | 404 // Used for nested schemes [currently only filesystem:]. |
| 404 scoped_ptr<GURL> inner_url_; | 405 scoped_ptr<GURL> inner_url_; |
| 405 | 406 |
| 406 // TODO bug 684583: Add encoding for query params. | 407 // TODO bug 684583: Add encoding for query params. |
| 407 }; | 408 }; |
| 408 | 409 |
| 409 // Stream operator so GURL can be used in assertion statements. | 410 // Stream operator so GURL can be used in assertion statements. |
| 410 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 411 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 411 | 412 |
| 412 #endif // URL_GURL_H_ | 413 #endif // URL_GURL_H_ |
| OLD | NEW |