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

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

Issue 6969077: net: Add NET_API to net/base (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 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_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 #pragma once 7 #pragma once
8 8
9 #include <string> 9 #include <string>
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "net/base/net_api.h"
11 12
12 struct addrinfo; 13 struct addrinfo;
13 class GURL; 14 class GURL;
14 15
15 namespace net { 16 namespace net {
16 17
17 class HostPortPair { 18 class NET_TEST HostPortPair {
wtc 2011/05/16 20:55:17 I suspect HostPortPair is used outside src/net, so
rvargas (doing something else) 2011/05/16 22:41:56 I missed that one. Thanks.
18 public: 19 public:
19 HostPortPair(); 20 HostPortPair();
20 // If |in_host| represents an IPv6 address, it should not bracket the address. 21 // If |in_host| represents an IPv6 address, it should not bracket the address.
21 HostPortPair(const std::string& in_host, uint16 in_port); 22 HostPortPair(const std::string& in_host, uint16 in_port);
22 23
23 // Creates a HostPortPair for the origin of |url|. 24 // Creates a HostPortPair for the origin of |url|.
24 static HostPortPair FromURL(const GURL& url); 25 static HostPortPair FromURL(const GURL& url);
25 26
26 // Creates a HostPortPair from an addrinfo struct. 27 // Creates a HostPortPair from an addrinfo struct.
27 static HostPortPair FromAddrInfo(const struct addrinfo* ai); 28 static HostPortPair FromAddrInfo(const struct addrinfo* ai);
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
65 private: 66 private:
66 // If |host_| represents an IPv6 address, this string will not contain 67 // If |host_| represents an IPv6 address, this string will not contain
67 // brackets around the address. 68 // brackets around the address.
68 std::string host_; 69 std::string host_;
69 uint16 port_; 70 uint16 port_;
70 }; 71 };
71 72
72 } // namespace net 73 } // namespace net
73 74
74 #endif // NET_BASE_HOST_PORT_PAIR_H_ 75 #endif // NET_BASE_HOST_PORT_PAIR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698