Commit b44ea7ff authored by Matt Menke's avatar Matt Menke Committed by Commit Bot

Remove a check for valid DNS names in SystemHostResolverCall.

HostResolver already has a check before lookups reach that point. Added
a DCHECK instead. Also remove a histogram that was broken in
https://chromium-review.googlesource.com/569298.

Bug: 496468
Change-Id: Ie2f78c48c2d251e8c563323464270516a6a00ff3
Reviewed-on: https://chromium-review.googlesource.com/578168
Commit-Queue: Matt Menke <mmenke@chromium.org>
Reviewed-by: default avatarMiriam Gershenson <mgersh@chromium.org>
Reviewed-by: default avatarJesse Doherty <jwd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#488416}
parent 862fa61c
......@@ -7,7 +7,6 @@
#include "build/build_config.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/sys_byteorder.h"
#include "net/base/address_list.h"
#include "net/base/net_errors.h"
......@@ -126,16 +125,9 @@ int SystemHostResolverCall(const std::string& host,
HostResolverFlags host_resolver_flags,
AddressList* addrlist,
int* os_error) {
// Make sure |host| is properly formed. Save the validity check result so that
// we can count how often invalid names (see |net::IsValidHostLabelCharacter|)
// successfully resolve, if ever. TODO(crbug.com/695474): Remove this when we
// no longer need the UMA metrics.
bool valid_hostname = false;
{
std::string out_ignored;
if (!DNSDomainFromDot(host, &out_ignored))
return ERR_NAME_NOT_RESOLVED;
}
// |host| should be a valid domain name. HostResolverImpl::Resolve has checks
// to fail early if this is not the case.
DCHECK(IsValidDNSDomain(host));
if (os_error)
*os_error = 0;
......@@ -258,8 +250,6 @@ int SystemHostResolverCall(const std::string& host,
*addrlist = AddressList::CreateFromAddrinfo(ai);
freeaddrinfo(ai);
UMA_HISTOGRAM_BOOLEAN("Net.SuccessfulResolutionWithValidDNSName",
valid_hostname);
return OK;
}
......
......@@ -42367,6 +42367,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<histogram name="Net.SuccessfulResolutionWithValidDNSName" enum="Boolean">
<owner>palmer@chromium.org</owner>
<obsolete>
Removed in 07/2017.
</obsolete>
<summary>
True if a DNS name contains only characters for which
|net::IsValidLabelCharacter| returns true. Used to see if we can deprecate
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment