summaryrefslogtreecommitdiffstats
path: root/net/proxy
diff options
context:
space:
mode:
Diffstat (limited to 'net/proxy')
-rw-r--r--net/proxy/proxy_server.cc6
-rw-r--r--net/proxy/proxy_server.h7
-rw-r--r--net/proxy/proxy_server_mac.cc4
3 files changed, 7 insertions, 10 deletions
diff --git a/net/proxy/proxy_server.cc b/net/proxy/proxy_server.cc
index 792a47d..f172a6b 100644
--- a/net/proxy/proxy_server.cc
+++ b/net/proxy/proxy_server.cc
@@ -70,8 +70,8 @@ std::string HostNoBrackets(const std::string& host) {
} // namespace
-ProxyServer::ProxyServer(Scheme scheme, const std::string& host, int port)
- : scheme_(scheme), host_port_pair_(HostNoBrackets(host), port) {
+ProxyServer::ProxyServer(Scheme scheme, const HostPortPair& host_port_pair)
+ : scheme_(scheme), host_port_pair_(host_port_pair) {
}
const HostPortPair& ProxyServer::host_port_pair() const {
@@ -222,7 +222,7 @@ ProxyServer ProxyServer::FromSchemeHostAndPort(
if (port == -1)
port = GetDefaultPortForScheme(scheme);
- return ProxyServer(scheme, host, port);
+ return ProxyServer(scheme, HostPortPair(HostNoBrackets(host), port));
}
} // namespace net
diff --git a/net/proxy/proxy_server.h b/net/proxy/proxy_server.h
index 18124fc..689fd6b 100644
--- a/net/proxy/proxy_server.h
+++ b/net/proxy/proxy_server.h
@@ -38,10 +38,7 @@ class ProxyServer {
// Constructs an invalid ProxyServer.
ProxyServer() : scheme_(SCHEME_INVALID) {}
- // TODO(thestig) Replace |host| and |port| with HostPortPair.
- // If |host| is an IPv6 literal address, it must include the square
- // brackets.
- ProxyServer(Scheme scheme, const std::string& host, int port);
+ ProxyServer(Scheme scheme, const HostPortPair& host_port_pair);
bool is_valid() const { return scheme_ != SCHEME_INVALID; }
@@ -108,7 +105,7 @@ class ProxyServer {
// Returns a ProxyServer representing DIRECT connections.
static ProxyServer Direct() {
- return ProxyServer(SCHEME_DIRECT, std::string(), -1);
+ return ProxyServer(SCHEME_DIRECT, HostPortPair());
}
#if defined(OS_MACOSX)
diff --git a/net/proxy/proxy_server_mac.cc b/net/proxy/proxy_server_mac.cc
index 44c21cd..61e320f 100644
--- a/net/proxy/proxy_server_mac.cc
+++ b/net/proxy/proxy_server_mac.cc
@@ -21,7 +21,7 @@ ProxyServer ProxyServer::FromDictionary(Scheme scheme,
CFStringRef port_key) {
if (scheme == SCHEME_INVALID || scheme == SCHEME_DIRECT) {
// No hostname port to extract; we are done.
- return ProxyServer(scheme, std::string(), -1);
+ return ProxyServer(scheme, HostPortPair());
}
CFStringRef host_ref =
@@ -45,7 +45,7 @@ ProxyServer ProxyServer::FromDictionary(Scheme scheme,
port = GetDefaultPortForScheme(scheme);
}
- return ProxyServer(scheme, host, port);
+ return ProxyServer(scheme, HostPortPair(host, port));
}
} // namespace net