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

Side by Side Diff: chrome/browser/metrics/rappor/sampling.cc

Issue 311133006: Add more Rappor metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 6 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 unified diff | Download patch
OLDNEW
(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 "chrome/browser/metrics/rappor/sampling.h"
6
7 #include "chrome/browser/browser_process.h"
8 #include "components/rappor/rappor_service.h"
9 #include "net/base/registry_controlled_domains/registry_controlled_domain.h"
10
11 namespace rappor {
12
13 void SampleDomainAndRegistryFromGURL(const std::string& metric,
14 const GURL& gurl) {
15 if (!g_browser_process->rappor_service())
16 return;
17 g_browser_process->rappor_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));
22 }
23
24 void SampleDomainAndRegistryFromHost(const std::string& metric,
25 const std::string& host) {
26 if (!g_browser_process->rappor_service())
27 return;
28 g_browser_process->rappor_service()->RecordSample(
29 metric,
30 rappor::ETLD_PLUS_ONE_RAPPOR_TYPE,
31 net::registry_controlled_domains::GetDomainAndRegistry(
32 host, net::registry_controlled_domains::INCLUDE_PRIVATE_REGISTRIES));
33 }
34
35 } // namespace rappor
OLDNEW
« no previous file with comments | « chrome/browser/metrics/rappor/sampling.h ('k') | chrome/browser/metrics/rappor/sampling_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698