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

Unified Diff: net/base/ip_address.cc

Issue 1809863002: Update some callers to use more direct ways of constructing IPAddress from well known literals. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 side-by-side diff with in-line comments
Download patch
Index: net/base/ip_address.cc
diff --git a/net/base/ip_address.cc b/net/base/ip_address.cc
index 075d4d00326f8bae9b9ed23fe8cd72fa9bc4b2ae..606483b0bf65f829fc67f31a8b46eb83aa6600a1 100644
--- a/net/base/ip_address.cc
+++ b/net/base/ip_address.cc
@@ -89,6 +89,16 @@ IPAddress IPAddress::AllZeros(size_t num_zero_bytes) {
return IPAddress(std::vector<uint8_t>(num_zero_bytes));
}
+// static
+IPAddress IPAddress::IPv4AllZeros() {
+ return AllZeros(kIPv4AddressSize);
+}
+
+// static
+IPAddress IPAddress::IPv6AllZeros() {
+ return AllZeros(kIPv6AddressSize);
+}
+
bool IPAddress::operator==(const IPAddress& that) const {
return ip_address_ == that.ip_address_;
}

Powered by Google App Engine
This is Rietveld 408576698