summaryrefslogtreecommitdiffstats
path: root/url
diff options
context:
space:
mode:
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 {