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..2aed58b5b229562cc16d70185d079d490359b419 100644 |
| --- a/chrome/browser/metrics/rappor/sampling.cc |
| +++ b/chrome/browser/metrics/rappor/sampling.cc |
| @@ -6,12 +6,19 @@ |
| #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" |
| namespace rappor { |
| std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl) { |
| + if (net::IsLocalhost(gurl.host())) { |
|
Alexei Svitkine (slow)
2015/02/18 21:22:20
Nit: No {}'s. Same below.
Steven Holte
2015/02/19 23:42:19
Done.
|
| + return "localhost"; |
|
Nathan Parker
2015/02/18 21:56:46
I think this should go inside the if IsHTTPorHTTPS
Steven Holte
2015/02/19 23:42:19
Done.
|
| + } |
| + if (gurl.HostIsIPAddress()) { |
| + return "ip_address"; |
| + } |
| if (gurl.SchemeIsHTTPOrHTTPS()) { |
| return net::registry_controlled_domains::GetDomainAndRegistry( |
| gurl, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES); |