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

Unified Diff: net/dns/dns_util.cc

Issue 2906723002: Track how often we would attempt to resolve non-'compliant' domain names. (Closed)
Patch Set: Respond to comments. Created 3 years, 7 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_util.cc
diff --git a/net/dns/dns_util.cc b/net/dns/dns_util.cc
index 8eff1c6425eb204366eaf144b72e691b3f59c805..06becc2b48b7e223e4ff57243b2c577db868caef 100644
--- a/net/dns/dns_util.cc
+++ b/net/dns/dns_util.cc
@@ -15,7 +15,9 @@
#include "base/strings/string_split.h"
#include "build/build_config.h"
#include "net/base/address_list.h"
+#include "net/base/url_util.h"
#include "net/dns/dns_protocol.h"
+#include "url/url_canon.h"
namespace {
@@ -74,13 +76,20 @@ bool DNSDomainFromDot(const base::StringPiece& dotted, std::string* out) {
return false;
if (!IsValidHostLabelCharacter(ch, labellen == 0)) {
// TODO(palmer): In the future, when we can remove support for invalid
- // names, return false here instead (and remove the UMA counter).
+ // names, return false here instead (and remove the Net.Valid*DNSName UMA
+ // counters).
valid_name = false;
}
label[labellen++] = ch;
}
UMA_HISTOGRAM_BOOLEAN("Net.ValidDNSName", valid_name);
+ if (valid_name) {
+ url::CanonHostInfo info;
+ UMA_HISTOGRAM_BOOLEAN("Net.DNSNameCompliantIfValid",
+ net::IsCanonicalizedHostCompliant(
+ net::CanonicalizeHost(dotted, &info)));
+ }
// Allow empty label at end of name to disable suffix search.
if (labellen) {
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698