| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 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_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ | 5 #ifndef NET_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ |
| 6 #define NET_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ | 6 #define NET_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "net/quic/platform/api/quic_export.h" | 10 #include "net/quic/platform/api/quic_export.h" |
| 11 #include "net/quic/platform/impl/quic_ip_address_impl.h" | 11 #include "net/quic/platform/impl/quic_ip_address_impl.h" |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 class QUIC_EXPORT_PRIVATE QuicIpAddress { | 15 class QUIC_EXPORT_PRIVATE QuicIpAddress { |
| 16 // A class representing an IPv4 or IPv6 address in QUIC. The actual | 16 // A class representing an IPv4 or IPv6 address in QUIC. The actual |
| 17 // implementation (platform dependent) of an IP address is in | 17 // implementation (platform dependent) of an IP address is in |
| 18 // QuicIpAddressImpl. | 18 // QuicIpAddressImpl. |
| 19 public: | 19 public: |
| 20 enum : size_t { | 20 enum : size_t { |
| 21 kIPv4AddressSize = QuicIpAddressImpl::kIPv4AddressSize, | 21 kIPv4AddressSize = QuicIpAddressImpl::kIPv4AddressSize, |
| 22 kIPv6AddressSize = QuicIpAddressImpl::kIPv6AddressSize | 22 kIPv6AddressSize = QuicIpAddressImpl::kIPv6AddressSize |
| 23 }; | 23 }; |
| 24 |
| 25 // TODO(fayang): Remove Loopback*() and use TestLoopback*() in tests. |
| 24 static QuicIpAddress Loopback4(); | 26 static QuicIpAddress Loopback4(); |
| 25 static QuicIpAddress Loopback6(); | 27 static QuicIpAddress Loopback6(); |
| 26 static QuicIpAddress Any4(); | 28 static QuicIpAddress Any4(); |
| 27 static QuicIpAddress Any6(); | 29 static QuicIpAddress Any6(); |
| 28 | 30 |
| 29 QuicIpAddress() = default; | 31 QuicIpAddress() = default; |
| 30 QuicIpAddress(const QuicIpAddress& other) = default; | 32 QuicIpAddress(const QuicIpAddress& other) = default; |
| 31 explicit QuicIpAddress(const QuicIpAddressImpl& impl); | 33 explicit QuicIpAddress(const QuicIpAddressImpl& impl); |
| 32 QuicIpAddress& operator=(const QuicIpAddress& other) = default; | 34 QuicIpAddress& operator=(const QuicIpAddress& other) = default; |
| 33 QuicIpAddress& operator=(QuicIpAddress&& other) = default; | 35 QuicIpAddress& operator=(QuicIpAddress&& other) = default; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 62 | 64 |
| 63 const QuicIpAddressImpl& impl() const { return impl_; } | 65 const QuicIpAddressImpl& impl() const { return impl_; } |
| 64 | 66 |
| 65 private: | 67 private: |
| 66 QuicIpAddressImpl impl_; | 68 QuicIpAddressImpl impl_; |
| 67 }; | 69 }; |
| 68 | 70 |
| 69 } // namespace net | 71 } // namespace net |
| 70 | 72 |
| 71 #endif // NET_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ | 73 #endif // NET_QUIC_PLATFORM_API_QUIC_IP_ADDRESS_H_ |
| OLD | NEW |