Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(568)

Unified Diff: url/scheme_host_port.cc

Issue 1858093002: Alt-Svc 8: Change Supports SPDY list using SHP as the key. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@alt_svc_7
Patch Set: server pref changes Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « url/scheme_host_port.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: url/scheme_host_port.cc
diff --git a/url/scheme_host_port.cc b/url/scheme_host_port.cc
index 4d0f0007595561d99bb54ffb61c57cee033b21e5..86510615cdf8287f488ccbb513426c0e1edae69a 100644
--- a/url/scheme_host_port.cc
+++ b/url/scheme_host_port.cc
@@ -137,6 +137,12 @@ SchemeHostPort::SchemeHostPort(const GURL& url) : port_(0) {
SchemeHostPort::~SchemeHostPort() {
}
+// static
+SchemeHostPort SchemeHostPort::FromString(const std::string& url_string) {
+ GURL url(url_string);
+ return SchemeHostPort(url);
+}
+
bool SchemeHostPort::IsInvalid() const {
return scheme_.empty() && host_.empty() && !port_;
}
@@ -167,6 +173,15 @@ std::string SchemeHostPort::Serialize() const {
return result;
}
+std::string SchemeHostPort::ToString() const {
+ std::string ret(scheme());
+ ret += "://";
+ ret += host();
+ ret += ':';
+ ret += base::UintToString(port());
+ return ret;
+}
+
bool SchemeHostPort::Equals(const SchemeHostPort& other) const {
return port_ == other.port() && scheme_ == other.scheme() &&
host_ == other.host();
« no previous file with comments | « url/scheme_host_port.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698