OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // This file defines a set of user experience metrics data recorded by | 5 // This file defines a set of user experience metrics data recorded by |
6 // the MetricsService. This is the unit of data that is sent to the server. | 6 // the MetricsService. This is the unit of data that is sent to the server. |
7 | 7 |
8 #ifndef CHROME_COMMON_METRICS_HELPERS_H_ | 8 #ifndef CHROME_COMMON_METRICS_HELPERS_H_ |
9 #define CHROME_COMMON_METRICS_HELPERS_H_ | 9 #define CHROME_COMMON_METRICS_HELPERS_H_ |
10 #pragma once | 10 #pragma once |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
178 // for transmission (such as from renderer to browser, or from browser to UMA | 178 // for transmission (such as from renderer to browser, or from browser to UMA |
179 // upload). It has several pure virtual functions that are replaced in | 179 // upload). It has several pure virtual functions that are replaced in |
180 // derived classes to allow the exact lower level transmission mechanism, | 180 // derived classes to allow the exact lower level transmission mechanism, |
181 // or error report mechanism, to be replaced. Since histograms can sit in | 181 // or error report mechanism, to be replaced. Since histograms can sit in |
182 // memory for an extended period of time, and are vulnerable to memory | 182 // memory for an extended period of time, and are vulnerable to memory |
183 // corruption, this class also validates as much rendundancy as it can before | 183 // corruption, this class also validates as much rendundancy as it can before |
184 // calling for the marginal change (a.k.a., delta) in a histogram to be sent | 184 // calling for the marginal change (a.k.a., delta) in a histogram to be sent |
185 // onward. | 185 // onward. |
186 class HistogramSender { | 186 class HistogramSender { |
187 protected: | 187 protected: |
188 HistogramSender() {} | 188 HistogramSender(); |
189 virtual ~HistogramSender() {} | 189 virtual ~HistogramSender(); |
190 | 190 |
191 // Snapshot all histograms, and transmit the delta. | 191 // Snapshot all histograms, and transmit the delta. |
192 // The arguments allow a derived class to select only a subset for | 192 // The arguments allow a derived class to select only a subset for |
193 // transmission, or to set a flag in each transmitted histogram. | 193 // transmission, or to set a flag in each transmitted histogram. |
194 void TransmitAllHistograms(base::Histogram::Flags flags_to_set, | 194 void TransmitAllHistograms(base::Histogram::Flags flags_to_set, |
195 bool send_only_uma); | 195 bool send_only_uma); |
196 | 196 |
197 // Send the histograms onward, as defined in a derived class. | 197 // Send the histograms onward, as defined in a derived class. |
198 // This is only called with a delta, listing samples that have not previously | 198 // This is only called with a delta, listing samples that have not previously |
199 // been transmitted. | 199 // been transmitted. |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 const base::Histogram& histogram, | 268 const base::Histogram& histogram, |
269 const base::Histogram::SampleSet& snapshot); | 269 const base::Histogram::SampleSet& snapshot); |
270 virtual void InconsistencyDetected(int problem); | 270 virtual void InconsistencyDetected(int problem); |
271 virtual void UniqueInconsistencyDetected(int problem); | 271 virtual void UniqueInconsistencyDetected(int problem); |
272 virtual void SnapshotProblemResolved(int amount); | 272 virtual void SnapshotProblemResolved(int amount); |
273 | 273 |
274 DISALLOW_COPY_AND_ASSIGN(MetricsServiceBase); | 274 DISALLOW_COPY_AND_ASSIGN(MetricsServiceBase); |
275 }; | 275 }; |
276 | 276 |
277 #endif // CHROME_COMMON_METRICS_HELPERS_H_ | 277 #endif // CHROME_COMMON_METRICS_HELPERS_H_ |
OLD | NEW |