summaryrefslogtreecommitdiffstats
path: root/url
diff options
context:
space:
mode:
authorcdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-22 01:43:33 +0000
committercdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-22 01:43:33 +0000
commit91f568903f5d067e7a82b2543434ba13b9dee9ef (patch)
treebe24ab4ddd5fbc657bef13e3b5cf7ad83a82fcce /url
parent31268815420a038ad43ba7808862f97a8a129801 (diff)
downloadchromium_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.cc4
-rw-r--r--url/gurl.h3
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);
diff --git a/url/gurl.h b/url/gurl.h
index da5f736..4b986a6 100644
--- a/url/gurl.h
+++ b/url/gurl.h
@@ -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 {