Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "components/rappor/rappor_utils.h" | |
| 6 | |
| 7 #include "components/rappor/rappor_service.h" | |
| 8 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | |
| 9 | |
| 10 namespace rappor { | |
| 11 | |
| 12 void SampleETLDp1FromGURL(RapporService* service, | |
| 13 const std::string& metric, | |
| 14 const GURL& gurl) { | |
| 15 if (!service) | |
| 16 return; | |
| 17 service->RecordSample(metric, | |
| 18 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, | |
|
Peter Kasting
2014/06/05 23:37:14
Nit: All lines of args must be indented the same.
Steven Holte
2014/06/06 01:54:25
Done.
| |
| 19 net::registry_controlled_domains::GetDomainAndRegistry(gurl, | |
| 20 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)); | |
| 21 } | |
| 22 | |
| 23 void SampleETLDp1FromHost(RapporService* service, | |
| 24 const std::string& metric, | |
| 25 const std::string& host) { | |
| 26 if (!service) | |
| 27 return; | |
| 28 service->RecordSample(metric, | |
| 29 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, | |
| 30 net::registry_controlled_domains::GetDomainAndRegistry(host, | |
| 31 net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)); | |
| 32 } | |
| 33 | |
| 34 } // namespace rappor | |
| OLD | NEW |