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

Side by Side Diff: net/base/host_port_pair.h

Issue 1808001: Implement a 15 connection per proxy server limit. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: Remove extra newline. Created 10 years, 7 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 | « no previous file | net/http/http_network_session.h » ('j') | net/http/http_network_session.cc » ('J')
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_BASE_HOST_PORT_PAIR_H_ 5 #ifndef NET_BASE_HOST_PORT_PAIR_H_
6 #define NET_BASE_HOST_PORT_PAIR_H_ 6 #define NET_BASE_HOST_PORT_PAIR_H_
7 7
8 #include <string> 8 #include <string>
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 10
11 namespace net { 11 namespace net {
12 12
13 struct HostPortPair { 13 struct HostPortPair {
14 HostPortPair(); 14 HostPortPair();
15 // If |in_host| represents an IPv6 address, it should not bracket the address. 15 // If |in_host| represents an IPv6 address, it should not bracket the address.
16 HostPortPair(const std::string& in_host, uint16 in_port); 16 HostPortPair(const std::string& in_host, uint16 in_port);
17 17
18 // TODO(willchan): Define a functor instead.
18 // Comparator function so this can be placed in a std::map. 19 // Comparator function so this can be placed in a std::map.
19 bool operator<(const HostPortPair& other) const { 20 bool operator<(const HostPortPair& other) const {
20 if (host != other.host) 21 if (port != other.port)
21 return host < other.host; 22 return port < other.port;
22 return port < other.port; 23 return host < other.host;
23 } 24 }
24 25
25 // ToString() will convert the HostPortPair to "host:port". If |host| is an 26 // ToString() will convert the HostPortPair to "host:port". If |host| is an
26 // IPv6 literal, it will add brackets around |host|. 27 // IPv6 literal, it will add brackets around |host|.
27 std::string ToString() const; 28 std::string ToString() const;
28 29
29 // If |host| represents an IPv6 address, this string will not contain brackets 30 // If |host| represents an IPv6 address, this string will not contain brackets
30 // around the address. 31 // around the address.
31 std::string host; 32 std::string host;
32 uint16 port; 33 uint16 port;
33 }; 34 };
34 35
35 } // namespace net 36 } // namespace net
36 37
37 #endif // NET_BASE_HOST_PORT_PAIR_H_ 38 #endif // NET_BASE_HOST_PORT_PAIR_H_
OLDNEW
« no previous file with comments | « no previous file | net/http/http_network_session.h » ('j') | net/http/http_network_session.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698