Automated Commit: Committing new LKGM version 6953.0.0 for chromeos.
[chromium-blink-merge.git] / components / rappor / rappor_utils.h
blob721fade36a63bc7f8a4d4f1e9949adf8f363b1f1
1 // Copyright 2015 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.
5 #ifndef COMPONENTS_RAPPOR_RAPPOR_UTILS_H_
6 #define COMPONENTS_RAPPOR_RAPPOR_UTILS_H_
8 #include <string>
10 class GURL;
12 namespace rappor {
14 class RapporService;
16 // Extract the domain and registry for a sample from a GURL.
17 // For file:// urls this will just return "file://" and for other special
18 // schemes like chrome-extension will return the scheme and host.
19 std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl);
21 // Records the domain and registry of a url to a Rappor metric.
22 // If |rappor_service| is NULL, this call does nothing.
23 void SampleDomainAndRegistryFromGURL(RapporService* rappor_service,
24 const std::string& metric,
25 const GURL& gurl);
27 } // namespace rappor
29 #endif // COMPONENTS_RAPPOR_RAPPOR_UTILS_H_