| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/proxy/proxy_server.h" | 5 #include "net/proxy/proxy_server.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "net/base/net_util.h" | 10 #include "net/base/net_util.h" |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // have been specified. It is important for this to be consistent since we | 81 // have been specified. It is important for this to be consistent since we |
| 82 // do raw field comparisons in the equality and comparison functions. | 82 // do raw field comparisons in the equality and comparison functions. |
| 83 DCHECK(host_port_pair.Equals(HostPortPair())); | 83 DCHECK(host_port_pair.Equals(HostPortPair())); |
| 84 host_port_pair_ = HostPortPair(); | 84 host_port_pair_ = HostPortPair(); |
| 85 } | 85 } |
| 86 } | 86 } |
| 87 | 87 |
| 88 const HostPortPair& ProxyServer::host_port_pair() const { | 88 const HostPortPair& ProxyServer::host_port_pair() const { |
| 89 // Doesn't make sense to call this if the URI scheme doesn't | 89 // Doesn't make sense to call this if the URI scheme doesn't |
| 90 // have concept of a host. | 90 // have concept of a host. |
| 91 DCHECK(is_valid() && !is_direct()); | 91 DCHECK(is_valid()); |
| 92 DCHECK(!is_direct()); |
| 92 return host_port_pair_; | 93 return host_port_pair_; |
| 93 } | 94 } |
| 94 | 95 |
| 95 // static | 96 // static |
| 96 ProxyServer ProxyServer::FromURI(const std::string& uri, | 97 ProxyServer ProxyServer::FromURI(const std::string& uri, |
| 97 Scheme default_scheme) { | 98 Scheme default_scheme) { |
| 98 return FromURI(uri.begin(), uri.end(), default_scheme); | 99 return FromURI(uri.begin(), uri.end(), default_scheme); |
| 99 } | 100 } |
| 100 | 101 |
| 101 // static | 102 // static |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 if (port == -1) | 246 if (port == -1) |
| 246 port = GetDefaultPortForScheme(scheme); | 247 port = GetDefaultPortForScheme(scheme); |
| 247 | 248 |
| 248 host_port_pair = HostPortPair(HostNoBrackets(host), port); | 249 host_port_pair = HostPortPair(HostNoBrackets(host), port); |
| 249 } | 250 } |
| 250 | 251 |
| 251 return ProxyServer(scheme, host_port_pair); | 252 return ProxyServer(scheme, host_port_pair); |
| 252 } | 253 } |
| 253 | 254 |
| 254 } // namespace net | 255 } // namespace net |
| OLD | NEW |