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

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

Issue 6685013: Use IPEndPoint for P2P IPC messages (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: - Created 9 years, 9 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) 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_BASE_IP_ENDPOINT_H_ 5 #ifndef NET_BASE_IP_ENDPOINT_H_
6 #define NET_BASE_IP_ENDPOINT_H_ 6 #define NET_BASE_IP_ENDPOINT_H_
7 #pragma once 7 #pragma once
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "net/base/net_util.h" 10 #include "net/base/net_util.h"
(...skipping 26 matching lines...) Expand all
37 // the address that was copied into |address|. 37 // the address that was copied into |address|.
38 // Returns true on success, false on failure. 38 // Returns true on success, false on failure.
39 bool ToSockAddr(struct sockaddr* address, size_t* address_length) const; 39 bool ToSockAddr(struct sockaddr* address, size_t* address_length) const;
40 40
41 // Convert from a sockaddr struct. 41 // Convert from a sockaddr struct.
42 // |address| is the address. 42 // |address| is the address.
43 // |address_length| is the length of |address|. 43 // |address_length| is the length of |address|.
44 // Returns true on success, false on failure. 44 // Returns true on success, false on failure.
45 bool FromSockAddr(const struct sockaddr* address, size_t address_length); 45 bool FromSockAddr(const struct sockaddr* address, size_t address_length);
46 46
47 // Returns value as a string (e.g. "127.0.0.1:80"). Returns empty
48 // string if the address is invalid, and cannot not be converted to a
49 // string.
50 std::string ToString() const;
51
47 bool operator<(const IPEndPoint& that) const; 52 bool operator<(const IPEndPoint& that) const;
48 bool operator==(const IPEndPoint& that) const; 53 bool operator==(const IPEndPoint& that) const;
49 54
50 private: 55 private:
51 IPAddressNumber address_; 56 IPAddressNumber address_;
52 int port_; 57 int port_;
53 }; 58 };
54 59
55 } // namespace net 60 } // namespace net
56 61
57 #endif // NET_BASE_IP_ENDPOINT_H_ 62 #endif // NET_BASE_IP_ENDPOINT_H_
OLDNEW
« no previous file with comments | « content/content_common.gypi ('k') | net/base/ip_endpoint.cc » ('j') | net/base/ip_endpoint.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698