• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #ifndef CHROME_BROWSER_METRICS_RAPPOR_SAMPLING_H_
6 #define CHROME_BROWSER_METRICS_RAPPOR_SAMPLING_H_
7 
8 #include <string>
9 
10 class GURL;
11 
12 namespace rappor {
13 
14 // Extract the domain and registry for a sample from a GURL.
15 // For file:// urls this will just return "file://" and for other special
16 // schemes like chrome-extension will return the scheme and host.
17 std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl);
18 
19 // Records the domain and registry of a url to a Rappor metric.
20 // If the Rappor service is NULL, such as during tests, this call does nothing.
21 void SampleDomainAndRegistryFromGURL(const std::string& metric,
22                                      const GURL& gurl);
23 
24 }  // namespace rappor
25 
26 #endif  // CHROME_BROWSER_METRICS_RAPPOR_SAMPLING_H_
27