Chromium Code Reviews| 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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 196 // includes file: and filesystem:, which some callers may want to filter out | 196 // includes file: and filesystem:, which some callers may want to filter out |
| 197 // explicitly by calling SchemeIsFile[System]. | 197 // explicitly by calling SchemeIsFile[System]. |
| 198 bool IsStandard() const; | 198 bool IsStandard() const; |
| 199 | 199 |
| 200 // Returns true if the given parameter (should be lower-case ASCII to match | 200 // Returns true if the given parameter (should be lower-case ASCII to match |
| 201 // the canonicalized scheme) is the scheme for this URL. This call is more | 201 // the canonicalized scheme) is the scheme for this URL. This call is more |
| 202 // efficient than getting the scheme and comparing it because no copies or | 202 // efficient than getting the scheme and comparing it because no copies or |
| 203 // object constructions are done. | 203 // object constructions are done. |
| 204 bool SchemeIs(const char* lower_ascii_scheme) const; | 204 bool SchemeIs(const char* lower_ascii_scheme) const; |
| 205 | 205 |
| 206 // Returns true if the scheme is "http" or "https". | |
| 207 bool SchemeIsHttp() const; | |
|
abarth-chromium
2013/08/19 18:10:26
SchemeIsHttpFamily?
It would surprise me if a fun
Cris Neckar
2013/08/19 20:15:49
Done.
| |
| 208 | |
| 206 // We often need to know if this is a file URL. File URLs are "standard", but | 209 // We often need to know if this is a file URL. File URLs are "standard", but |
| 207 // are often treated separately by some programs. | 210 // are often treated separately by some programs. |
| 208 bool SchemeIsFile() const { | 211 bool SchemeIsFile() const { |
| 209 return SchemeIs("file"); | 212 return SchemeIs("file"); |
| 210 } | 213 } |
| 211 | 214 |
| 212 // FileSystem URLs need to be treated differently in some cases. | 215 // FileSystem URLs need to be treated differently in some cases. |
| 213 bool SchemeIsFileSystem() const { | 216 bool SchemeIsFileSystem() const { |
| 214 return SchemeIs("filesystem"); | 217 return SchemeIs("filesystem"); |
| 215 } | 218 } |
| (...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 // Used for nested schemes [currently only filesystem:]. | 369 // Used for nested schemes [currently only filesystem:]. |
| 367 GURL* inner_url_; | 370 GURL* inner_url_; |
| 368 | 371 |
| 369 // TODO bug 684583: Add encoding for query params. | 372 // TODO bug 684583: Add encoding for query params. |
| 370 }; | 373 }; |
| 371 | 374 |
| 372 // Stream operator so GURL can be used in assertion statements. | 375 // Stream operator so GURL can be used in assertion statements. |
| 373 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); | 376 URL_EXPORT std::ostream& operator<<(std::ostream& out, const GURL& url); |
| 374 | 377 |
| 375 #endif // URL_GURL_H_ | 378 #endif // URL_GURL_H_ |
| OLD | NEW |