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

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

Issue 3197018: Refactor: change the spdy session pool key to take a ProxyServer instead of a stri... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « net/http/http_stream_request.cc ('k') | net/proxy/proxy_server.cc » ('j') | 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 #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 #pragma once 7 #pragma once
8 8
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 // Returns the default port number for a proxy server with the specified 126 // Returns the default port number for a proxy server with the specified
127 // scheme. Returns -1 if unknown. 127 // scheme. Returns -1 if unknown.
128 static int GetDefaultPortForScheme(Scheme scheme); 128 static int GetDefaultPortForScheme(Scheme scheme);
129 129
130 bool operator==(const ProxyServer& other) const { 130 bool operator==(const ProxyServer& other) const {
131 return scheme_ == other.scheme_ && 131 return scheme_ == other.scheme_ &&
132 host_port_pair_.Equals(other.host_port_pair_); 132 host_port_pair_.Equals(other.host_port_pair_);
133 } 133 }
134 134
135 // Comparator function so this can be placed in a std::map.
136 bool operator<(const ProxyServer& other) const {
137 if (scheme_ != other.scheme_)
138 return scheme_ < other.scheme_;
139 return host_port_pair_ < other.host_port_pair_;
140 }
141
135 private: 142 private:
136 // Creates a ProxyServer given a scheme, and host/port string. If parsing the 143 // Creates a ProxyServer given a scheme, and host/port string. If parsing the
137 // host/port string fails, the returned instance will be invalid. 144 // host/port string fails, the returned instance will be invalid.
138 static ProxyServer FromSchemeHostAndPort( 145 static ProxyServer FromSchemeHostAndPort(
139 Scheme scheme, 146 Scheme scheme,
140 std::string::const_iterator host_and_port_begin, 147 std::string::const_iterator host_and_port_begin,
141 std::string::const_iterator host_and_port_end); 148 std::string::const_iterator host_and_port_end);
142 149
143 Scheme scheme_; 150 Scheme scheme_;
144 HostPortPair host_port_pair_; 151 HostPortPair host_port_pair_;
145 }; 152 };
146 153
147 } // namespace net 154 } // namespace net
148 155
149 #endif // NET_PROXY_PROXY_SERVER_H_ 156 #endif // NET_PROXY_PROXY_SERVER_H_
OLDNEW
« no previous file with comments | « net/http/http_stream_request.cc ('k') | net/proxy/proxy_server.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698