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

Side by Side Diff: components/rappor/rappor_utils.h

Issue 1070863002: Add rappor::SampleString for consisntecy with domain+registry case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rename to SampleString Created 5 years, 8 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
« no previous file with comments | « no previous file | components/rappor/rappor_utils.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef COMPONENTS_RAPPOR_RAPPOR_UTILS_H_ 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_UTILS_H_
6 #define COMPONENTS_RAPPOR_RAPPOR_UTILS_H_ 6 #define COMPONENTS_RAPPOR_RAPPOR_UTILS_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "components/rappor/rappor_service.h"
11
10 class GURL; 12 class GURL;
11 13
12 namespace rappor { 14 namespace rappor {
13 15
14 class RapporService; 16 class RapporService;
15 17
18 // Records a string to a Rappor metric.
19 // If |rappor_service| is NULL, this call does nothing.
20 void SampleString(RapporService* rappor_service,
21 const std::string& metric,
22 RapporType type,
23 const std::string& sample);
24
16 // Extract the domain and registry for a sample from a GURL. 25 // Extract the domain and registry for a sample from a GURL.
17 // For file:// urls this will just return "file://" and for other special 26 // For file:// urls this will just return "file://" and for other special
18 // schemes like chrome-extension will return the scheme and host. 27 // schemes like chrome-extension will return the scheme and host.
19 std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl); 28 std::string GetDomainAndRegistrySampleFromGURL(const GURL& gurl);
20 29
21 // Records the domain and registry of a url to a Rappor metric. 30 // Records the domain and registry of a url to a Rappor metric.
22 // If |rappor_service| is NULL, this call does nothing. 31 // If |rappor_service| is NULL, this call does nothing.
23 void SampleDomainAndRegistryFromGURL(RapporService* rappor_service, 32 void SampleDomainAndRegistryFromGURL(RapporService* rappor_service,
24 const std::string& metric, 33 const std::string& metric,
25 const GURL& gurl); 34 const GURL& gurl);
26 35
27 } // namespace rappor 36 } // namespace rappor
28 37
29 #endif // COMPONENTS_RAPPOR_RAPPOR_UTILS_H_ 38 #endif // COMPONENTS_RAPPOR_RAPPOR_UTILS_H_
OLDNEW
« no previous file with comments | « no previous file | components/rappor/rappor_utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698