| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "base/trace_event/trace_event.h" |
| 5 #include "net/base/ip_endpoint.h" | 6 #include "net/base/ip_endpoint.h" |
| 6 | 7 |
| 7 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 8 | 9 |
| 9 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| 10 #include <winsock2.h> | 11 #include <winsock2.h> |
| 11 #include <ws2bth.h> | 12 #include <ws2bth.h> |
| 12 #elif defined(OS_POSIX) | 13 #elif defined(OS_POSIX) |
| 13 #include <netinet/in.h> | 14 #include <netinet/in.h> |
| 14 #endif | 15 #endif |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 } | 76 } |
| 76 #endif | 77 #endif |
| 77 | 78 |
| 78 return false; // Unrecognized |sa_family|. | 79 return false; // Unrecognized |sa_family|. |
| 79 } | 80 } |
| 80 | 81 |
| 81 } // namespace | 82 } // namespace |
| 82 | 83 |
| 83 IPEndPoint::IPEndPoint() : port_(0) {} | 84 IPEndPoint::IPEndPoint() : port_(0) {} |
| 84 | 85 |
| 85 IPEndPoint::~IPEndPoint() {} | 86 IPEndPoint::~IPEndPoint() { |
| 87 TRACE_EVENT0("toplevel", "IPEndPoint::~IPEndPoint"); |
| 88 } |
| 86 | 89 |
| 87 IPEndPoint::IPEndPoint(const IPAddressNumber& address, uint16_t port) | 90 IPEndPoint::IPEndPoint(const IPAddressNumber& address, uint16_t port) |
| 88 : address_(address), port_(port) { | 91 : address_(address), port_(port) { |
| 89 } | 92 } |
| 90 | 93 |
| 91 IPEndPoint::IPEndPoint(const IPAddress& address, uint16_t port) | 94 IPEndPoint::IPEndPoint(const IPAddress& address, uint16_t port) |
| 92 : address_(address), port_(port) {} | 95 : address_(address), port_(port) {} |
| 93 | 96 |
| 94 IPEndPoint::IPEndPoint(const IPEndPoint& endpoint) { | 97 IPEndPoint::IPEndPoint(const IPEndPoint& endpoint) { |
| 95 address_ = endpoint.address_; | 98 address_ = endpoint.address_; |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 return address_.size() < other.address_.size(); | 180 return address_.size() < other.address_.size(); |
| 178 } | 181 } |
| 179 return std::tie(address_, port_) < std::tie(other.address_, other.port_); | 182 return std::tie(address_, port_) < std::tie(other.address_, other.port_); |
| 180 } | 183 } |
| 181 | 184 |
| 182 bool IPEndPoint::operator==(const IPEndPoint& other) const { | 185 bool IPEndPoint::operator==(const IPEndPoint& other) const { |
| 183 return address_ == other.address_ && port_ == other.port_; | 186 return address_ == other.address_ && port_ == other.port_; |
| 184 } | 187 } |
| 185 | 188 |
| 186 } // namespace net | 189 } // namespace net |
| OLD | NEW |