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

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

Issue 509203002: Create a mechanism for reporting rappor metrics from non-UMA (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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_SERVICE_H_ 5 #ifndef COMPONENTS_RAPPOR_RAPPOR_SERVICE_H_
6 #define COMPONENTS_RAPPOR_RAPPOR_SERVICE_H_ 6 #define COMPONENTS_RAPPOR_RAPPOR_SERVICE_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 class LogUploader; 25 class LogUploader;
26 class RapporMetric; 26 class RapporMetric;
27 class RapporReports; 27 class RapporReports;
28 struct RapporParameters; 28 struct RapporParameters;
29 29
30 // The type of data stored in a metric. 30 // The type of data stored in a metric.
31 enum RapporType { 31 enum RapporType {
32 // For sampling the eTLD+1 of a URL. 32 // For sampling the eTLD+1 of a URL.
33 ETLD_PLUS_ONE_RAPPOR_TYPE = 0, 33 ETLD_PLUS_ONE_RAPPOR_TYPE = 0,
34 SAFE_BROWSING_PATTERN_RAPPOR_TYPE,
34 NUM_RAPPOR_TYPES 35 NUM_RAPPOR_TYPES
35 }; 36 };
36 37
37 // This class provides an interface for recording samples for rappor metrics, 38 // This class provides an interface for recording samples for rappor metrics,
38 // and periodically generates and uploads reports based on the collected data. 39 // and periodically generates and uploads reports based on the collected data.
39 class RapporService { 40 class RapporService {
40 public: 41 public:
41 RapporService(); 42 RapporService();
42 virtual ~RapporService(); 43 virtual ~RapporService();
43 44
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 103
103 // The cohort this client is assigned to. -1 is uninitialized. 104 // The cohort this client is assigned to. -1 is uninitialized.
104 int32_t cohort_; 105 int32_t cohort_;
105 106
106 // Timer which schedules calls to OnLogInterval(). 107 // Timer which schedules calls to OnLogInterval().
107 base::OneShotTimer<RapporService> log_rotation_timer_; 108 base::OneShotTimer<RapporService> log_rotation_timer_;
108 109
109 // A private LogUploader instance for sending reports to the server. 110 // A private LogUploader instance for sending reports to the server.
110 scoped_ptr<LogUploader> uploader_; 111 scoped_ptr<LogUploader> uploader_;
111 112
113 // True if we are collecting all metrics instead of only whitelisted ones.
114 bool all_metrics_enabled_;
115
112 // We keep all registered metrics in a map, from name to metric. 116 // We keep all registered metrics in a map, from name to metric.
113 // The map owns the metrics it contains. 117 // The map owns the metrics it contains.
114 std::map<std::string, RapporMetric*> metrics_map_; 118 std::map<std::string, RapporMetric*> metrics_map_;
115 119
116 DISALLOW_COPY_AND_ASSIGN(RapporService); 120 DISALLOW_COPY_AND_ASSIGN(RapporService);
117 }; 121 };
118 122
119 } // namespace rappor 123 } // namespace rappor
120 124
121 #endif // COMPONENTS_RAPPOR_RAPPOR_SERVICE_H_ 125 #endif // COMPONENTS_RAPPOR_RAPPOR_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698