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 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 // static | 206 // static |
207 ProxyServer::Scheme ProxyServer::GetSchemeFromURI(const std::string& scheme) { | 207 ProxyServer::Scheme ProxyServer::GetSchemeFromURI(const std::string& scheme) { |
208 return GetSchemeFromURIInternal(scheme.begin(), scheme.end()); | 208 return GetSchemeFromURIInternal(scheme.begin(), scheme.end()); |
209 } | 209 } |
210 | 210 |
211 // TODO(bengr): Use |scheme_| to indicate that this is the data reduction proxy. | 211 // TODO(bengr): Use |scheme_| to indicate that this is the data reduction proxy. |
212 #if defined(SPDY_PROXY_AUTH_ORIGIN) | 212 #if defined(SPDY_PROXY_AUTH_ORIGIN) |
213 bool ProxyServer::isDataReductionProxy() const { | 213 bool ProxyServer::isDataReductionProxy() const { |
214 return host_port_pair_.Equals( | 214 bool dev_host = false; |
| 215 #if defined (DATA_REDUCTION_DEV_HOST) |
| 216 dev_host = host_port_pair_.Equals( |
| 217 HostPortPair::FromURL(GURL(DATA_REDUCTION_DEV_HOST))); |
| 218 #endif |
| 219 return dev_host || host_port_pair_.Equals( |
215 HostPortPair::FromURL(GURL(SPDY_PROXY_AUTH_ORIGIN))); | 220 HostPortPair::FromURL(GURL(SPDY_PROXY_AUTH_ORIGIN))); |
216 } | 221 } |
217 | 222 |
218 bool ProxyServer::isDataReductionProxyFallback() const { | 223 bool ProxyServer::isDataReductionProxyFallback() const { |
219 #if defined(DATA_REDUCTION_FALLBACK_HOST) | 224 #if defined(DATA_REDUCTION_FALLBACK_HOST) |
220 return host_port_pair_.Equals( | 225 return host_port_pair_.Equals( |
221 HostPortPair::FromURL(GURL(DATA_REDUCTION_FALLBACK_HOST))); | 226 HostPortPair::FromURL(GURL(DATA_REDUCTION_FALLBACK_HOST))); |
222 #endif // defined(DATA_REDUCTION_FALLBACK_HOST) | 227 #endif // defined(DATA_REDUCTION_FALLBACK_HOST) |
223 return false; | 228 return false; |
224 } | 229 } |
(...skipping 25 matching lines...) Expand all Loading... |
250 if (port == -1) | 255 if (port == -1) |
251 port = GetDefaultPortForScheme(scheme); | 256 port = GetDefaultPortForScheme(scheme); |
252 | 257 |
253 host_port_pair = HostPortPair(HostNoBrackets(host), port); | 258 host_port_pair = HostPortPair(HostNoBrackets(host), port); |
254 } | 259 } |
255 | 260 |
256 return ProxyServer(scheme, host_port_pair); | 261 return ProxyServer(scheme, host_port_pair); |
257 } | 262 } |
258 | 263 |
259 } // namespace net | 264 } // namespace net |
OLD | NEW |