Chromium Code Reviews| Index: chrome/browser/metrics/rappor/sampling.cc |
| diff --git a/chrome/browser/metrics/rappor/sampling.cc b/chrome/browser/metrics/rappor/sampling.cc |
| index d5c01b3d3dcb8499c01d6e8c4826ec54172835b4..1000098ec635b3fe51556a4a12e285a4741341a0 100644 |
| --- a/chrome/browser/metrics/rappor/sampling.cc |
| +++ b/chrome/browser/metrics/rappor/sampling.cc |
| @@ -6,6 +6,7 @@ |
| #include "chrome/browser/browser_process.h" |
| #include "components/rappor/rappor_service.h" |
| +#include "net/base/net_util.h" |
| #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| #include "url/gurl.h" |
| @@ -13,6 +14,10 @@ namespace rappor { |
| std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl) { |
| if (gurl.SchemeIsHTTPOrHTTPS()) { |
| + if (net::IsLocalhost(gurl.host())) |
| + return "localhost"; |
| + if (gurl.HostIsIPAddress()) |
| + return "ip_address"; |
|
Nathan Parker
2015/02/20 18:47:04
Will the Rappor backend match against these string
Steven Holte
2015/02/20 19:47:11
Yes, I'll just add these to the list of strings we
|
| return net::registry_controlled_domains::GetDomainAndRegistry( |
| gurl, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |
| } |