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

Unified Diff: net/base/ip_endpoint.h

Issue 1408803010: Add IPAddress class as a replacement for the IPAddressNumber typedef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: net/base/ip_endpoint.h
diff --git a/net/base/ip_endpoint.h b/net/base/ip_endpoint.h
index 784ee031ed149dc1a7861f22d80f16afba2195e1..1f8b0c83e0e65fd9d6d23cdbaed2d20a2a159c17 100644
--- a/net/base/ip_endpoint.h
+++ b/net/base/ip_endpoint.h
@@ -10,6 +10,7 @@
#include "base/basictypes.h"
#include "base/compiler_specific.h"
#include "net/base/address_family.h"
+#include "net/base/ip_address.h"
#include "net/base/ip_address_number.h"
#include "net/base/net_export.h"
#include "net/base/sys_addrinfo.h"
@@ -26,9 +27,13 @@ class NET_EXPORT IPEndPoint {
IPEndPoint();
~IPEndPoint();
IPEndPoint(const IPAddressNumber& address, uint16_t port);
+ IPEndPoint(const IPAddress& address, uint16_t port);
IPEndPoint(const IPEndPoint& endpoint);
- const IPAddressNumber& address() const { return address_; }
+ // TODO(Martijnc): Remove the old version when all consumers are moved to
+ // IPAddress. https://crbug.com/496258
+ const IPAddressNumber& address() const { return address_.ip_address_; }
+ const IPAddress& addressNew() const { return address_; }
uint16_t port() const { return port_; }
// Returns AddressFamily of the address.
@@ -65,7 +70,7 @@ class NET_EXPORT IPEndPoint {
bool operator==(const IPEndPoint& that) const;
private:
- IPAddressNumber address_;
+ IPAddress address_;
uint16_t port_;
};

Powered by Google App Engine
This is Rietveld 408576698