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

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

Issue 382313003: Add data reduction functionality to all platforms. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed code review comments by asvitkine@. Created 6 years, 5 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #ifndef NET_PROXY_PROXY_SERVER_H_ 5 #ifndef NET_PROXY_PROXY_SERVER_H_
6 #define NET_PROXY_PROXY_SERVER_H_ 6 #define NET_PROXY_PROXY_SERVER_H_
7 7
8 #include "build/build_config.h" 8 #include "build/build_config.h"
9 9
10 #if defined(OS_MACOSX) 10 #if defined(OS_MACOSX)
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
147 host_port_pair_.Equals(other.host_port_pair_); 147 host_port_pair_.Equals(other.host_port_pair_);
148 } 148 }
149 149
150 // Comparator function so this can be placed in a std::map. 150 // Comparator function so this can be placed in a std::map.
151 bool operator<(const ProxyServer& other) const { 151 bool operator<(const ProxyServer& other) const {
152 if (scheme_ != other.scheme_) 152 if (scheme_ != other.scheme_)
153 return scheme_ < other.scheme_; 153 return scheme_ < other.scheme_;
154 return host_port_pair_ < other.host_port_pair_; 154 return host_port_pair_ < other.host_port_pair_;
155 } 155 }
156 156
157 #if defined(SPDY_PROXY_AUTH_ORIGIN)
158 // Returns true if this proxy server is the data reduction proxy or its
159 // fallback, respectively, as configured in gyp. These functions will return
160 // false for data reduction proxy servers specified on the command line.
161 bool isDataReductionProxy() const;
162 bool isDataReductionProxyFallback() const;
163 #endif // defined(SPDY_PROXY_AUTH_ORIGIN)
164
165 private: 157 private:
166 // Creates a ProxyServer given a scheme, and host/port string. If parsing the 158 // Creates a ProxyServer given a scheme, and host/port string. If parsing the
167 // host/port string fails, the returned instance will be invalid. 159 // host/port string fails, the returned instance will be invalid.
168 static ProxyServer FromSchemeHostAndPort( 160 static ProxyServer FromSchemeHostAndPort(
169 Scheme scheme, 161 Scheme scheme,
170 std::string::const_iterator host_and_port_begin, 162 std::string::const_iterator host_and_port_begin,
171 std::string::const_iterator host_and_port_end); 163 std::string::const_iterator host_and_port_end);
172 164
173 Scheme scheme_; 165 Scheme scheme_;
174 HostPortPair host_port_pair_; 166 HostPortPair host_port_pair_;
175 }; 167 };
176 168
177 typedef std::pair<HostPortPair, ProxyServer> HostPortProxyPair; 169 typedef std::pair<HostPortPair, ProxyServer> HostPortProxyPair;
178 170
179 } // namespace net 171 } // namespace net
180 172
181 #endif // NET_PROXY_PROXY_SERVER_H_ 173 #endif // NET_PROXY_PROXY_SERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698