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 SampleDomainAndRegistryFromGURL(RapporService* service, | |
13 const std::string& metric, | |
14 const GURL& gurl) { | |
15 if (!service) | |
16 return; | |
17 service->RecordSample( | |
18 metric, | |
19 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, | |
20 net::registry_controlled_domains::GetDomainAndRegistry( | |
21 gurl, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)); | |
battre
2014/06/06 09:49:43
please be aware that this does not record anything
Steven Holte
2014/06/06 21:00:50
Noted, though we should still be able to determine
| |
22 } | |
23 | |
24 void SampleDomainAndRegistryFromHost(RapporService* service, | |
25 const std::string& metric, | |
26 const std::string& host) { | |
27 if (!service) | |
28 return; | |
29 service->RecordSample( | |
30 metric, | |
31 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE, | |
32 net::registry_controlled_domains::GetDomainAndRegistry( | |
33 host, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES)); | |
34 } | |
35 | |
36 } // namespace rappor | |
OLD | NEW |