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

Unified Diff: net/base/ip_address_number.cc

Issue 1708483002: Revert of Make IP Address related functions return the empty string when used on an invalid address. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « net/base/ip_address_number.h ('k') | net/base/ip_address_number_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ip_address_number.cc
diff --git a/net/base/ip_address_number.cc b/net/base/ip_address_number.cc
index 07fb792d8b31b43cc972fb565a027761ba9d7f3d..1e44b7d3b1ebcc74873fa762eb0ced94411c188d 100644
--- a/net/base/ip_address_number.cc
+++ b/net/base/ip_address_number.cc
@@ -103,7 +103,7 @@
} else if (address_len == kIPv6AddressSize) {
url::AppendIPv6Address(address, &output);
} else {
- return std::string();
+ CHECK(false) << "Invalid IP address with length: " << address_len;
}
output.Complete();
@@ -114,8 +114,6 @@
size_t address_len,
uint16_t port) {
std::string address_str = IPAddressToString(address, address_len);
- if (address_str.empty())
- return address_str;
if (address_len == kIPv6AddressSize) {
// Need to bracket IPv6 addresses since they contain colons.
« no previous file with comments | « net/base/ip_address_number.h ('k') | net/base/ip_address_number_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698