diff options
author | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 01:43:33 +0000 |
---|---|---|
committer | cdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-08-22 01:43:33 +0000 |
commit | 91f568903f5d067e7a82b2543434ba13b9dee9ef (patch) | |
tree | be24ab4ddd5fbc657bef13e3b5cf7ad83a82fcce /url | |
parent | 31268815420a038ad43ba7808862f97a8a129801 (diff) | |
download | chromium_src-91f568903f5d067e7a82b2543434ba13b9dee9ef.zip chromium_src-91f568903f5d067e7a82b2543434ba13b9dee9ef.tar.gz chromium_src-91f568903f5d067e7a82b2543434ba13b9dee9ef.tar.bz2 |
Introduce GURL::SchemeIsHttpFamily(), which returns true for http and https.
BUG=274679
TEST=N/A
TBR=cbentzel, jamesr, simonjam, tzik, stevet, mpcomplete
Review URL: https://chromiumcodereview.appspot.com/23064011
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218893 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'url')
-rw-r--r-- | url/gurl.cc | 4 | ||||
-rw-r--r-- | url/gurl.h | 3 |
2 files changed, 7 insertions, 0 deletions
diff --git a/url/gurl.cc b/url/gurl.cc index 09b8abb..229df5d 100644 --- a/url/gurl.cc +++ b/url/gurl.cc @@ -367,6 +367,10 @@ bool GURL::SchemeIs(const char* lower_ascii_scheme) const { lower_ascii_scheme); } +bool GURL::SchemeIsHTTPOrHTTPS() const { + return SchemeIs("http") || SchemeIs("https"); +} + int GURL::IntPort() const { if (parsed_.port.is_nonempty()) return url_parse::ParsePort(spec_.data(), parsed_.port); @@ -203,6 +203,9 @@ class URL_EXPORT GURL { // object constructions are done. bool SchemeIs(const char* lower_ascii_scheme) const; + // Returns true if the scheme is "http" or "https". + bool SchemeIsHTTPOrHTTPS() const; + // We often need to know if this is a file URL. File URLs are "standard", but // are often treated separately by some programs. bool SchemeIsFile() const { |