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

Side by Side Diff: net/proxy/proxy_server.cc

Issue 105833010: Added Dev host for data reduction proxy controlled by Finch experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sync to head. Created 6 years, 11 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 unified diff | Download patch
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/common/chrome_switches.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698