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_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 5 #ifndef COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 6 #define COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/profiler/stack_sampling_profiler.h" | 10 #include "base/profiler/stack_sampling_profiler.h" |
11 #include "components/metrics/metrics_provider.h" | 11 #include "components/metrics/metrics_provider.h" |
12 | 12 |
13 namespace metrics { | 13 namespace metrics { |
14 class ChromeUserMetricsExtension; | 14 class ChromeUserMetricsExtension; |
15 | 15 |
16 // Performs metrics logging for the stack sampling profiler. | 16 // Performs metrics logging for the stack sampling profiler. |
17 class CallStackProfileMetricsProvider : public MetricsProvider { | 17 class CallStackProfileMetricsProvider : public MetricsProvider { |
18 public: | 18 public: |
19 CallStackProfileMetricsProvider(); | 19 CallStackProfileMetricsProvider(); |
20 ~CallStackProfileMetricsProvider() override; | 20 ~CallStackProfileMetricsProvider() override; |
21 | 21 |
22 // MetricsProvider: | 22 // MetricsProvider: |
23 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; | 23 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; |
24 | 24 |
25 // Uses |profiles| as the source data for the next invocation of | 25 // Uses |profiles| as the source data for the next invocation of |
26 // ProvideGeneralMetrics, rather than sourcing them from the | 26 // ProvideGeneralMetrics, rather than sourcing them from the |
27 // StackSamplingProfiler. | 27 // StackSamplingProfiler. |
28 void SetSourceProfilesForTesting( | 28 void SetSourceProfilesForTesting( |
29 const std::vector<base::StackSamplingProfiler::Profile>& profiles); | 29 const std::vector<base::StackSamplingProfiler::CallStackProfile>& |
| 30 profiles); |
30 | 31 |
31 private: | 32 private: |
32 std::vector<base::StackSamplingProfiler::Profile> source_profiles_for_test_; | 33 std::vector<base::StackSamplingProfiler::CallStackProfile> |
| 34 source_profiles_for_test_; |
33 | 35 |
34 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); | 36 DISALLOW_COPY_AND_ASSIGN(CallStackProfileMetricsProvider); |
35 }; | 37 }; |
36 | 38 |
37 } // namespace metrics | 39 } // namespace metrics |
38 | 40 |
39 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ | 41 #endif // COMPONENTS_METRICS_CALL_STACK_PROFILE_METRICS_PROVIDER_H_ |
OLD | NEW |