OLD | NEW |
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_SAMPLER_H_ | 5 #ifndef COMPONENTS_RAPPOR_SAMPLER_H_ |
6 #define COMPONENTS_RAPPOR_SAMPLER_H_ | 6 #define COMPONENTS_RAPPOR_SAMPLER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 // Generate randomized reports for all stored samples and store them | 35 // Generate randomized reports for all stored samples and store them |
36 // in |reports|, then discard the samples. | 36 // in |reports|, then discard the samples. |
37 void ExportMetrics(const std::string& secret, RapporReports* reports); | 37 void ExportMetrics(const std::string& secret, RapporReports* reports); |
38 | 38 |
39 private: | 39 private: |
40 // The number of samples recorded for each metric since the last export. | 40 // The number of samples recorded for each metric since the last export. |
41 std::map<std::string, int> sample_counts_; | 41 std::map<std::string, int> sample_counts_; |
42 | 42 |
43 // Stores a Sample for each metric, by metric name. | 43 // Stores a Sample for each metric, by metric name. |
44 base::ScopedPtrHashMap<std::string, Sample> samples_; | 44 base::ScopedPtrHashMap<std::string, scoped_ptr<Sample>> samples_; |
45 | 45 |
46 DISALLOW_COPY_AND_ASSIGN(Sampler); | 46 DISALLOW_COPY_AND_ASSIGN(Sampler); |
47 }; | 47 }; |
48 | 48 |
49 } // namespace internal | 49 } // namespace internal |
50 | 50 |
51 } // namespace rappor | 51 } // namespace rappor |
52 | 52 |
53 #endif // COMPONENTS_RAPPOR_SAMPLER_H_ | 53 #endif // COMPONENTS_RAPPOR_SAMPLER_H_ |
OLD | NEW |