OLD | NEW |
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_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ | 5 #ifndef COMPONENTS_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ |
6 #define COMPONENTS_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ | 6 #define COMPONENTS_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "components/metrics/metrics_provider.h" | 10 #include "components/metrics/metrics_provider.h" |
11 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" | 11 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" |
12 | 12 |
13 namespace tracked_objects { | 13 namespace tracked_objects { |
14 struct ProcessDataSnapshot; | 14 struct ProcessDataSnapshot; |
15 } | 15 } |
16 | 16 |
17 namespace metrics { | 17 namespace metrics { |
18 | 18 |
19 // ProfilerMetricsProvider is responsible for filling out the |profiler_event| | 19 // ProfilerMetricsProvider is responsible for filling out the |profiler_event| |
20 // section of the UMA proto. | 20 // section of the UMA proto. |
21 class ProfilerMetricsProvider : public MetricsProvider { | 21 class ProfilerMetricsProvider : public MetricsProvider { |
22 public: | 22 public: |
23 explicit ProfilerMetricsProvider( | 23 explicit ProfilerMetricsProvider( |
24 const base::Callback<void(bool*)>& cellular_callback); | 24 const base::Callback<void(bool*)>& cellular_callback); |
| 25 // Creates profiler metrics provider with a null callback. |
| 26 ProfilerMetricsProvider(); |
25 ~ProfilerMetricsProvider() override; | 27 ~ProfilerMetricsProvider() override; |
26 | 28 |
27 // MetricsDataProvider: | 29 // MetricsDataProvider: |
28 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; | 30 void ProvideGeneralMetrics(ChromeUserMetricsExtension* uma_proto) override; |
29 | 31 |
30 // Records the passed profiled data, which should be a snapshot of the | 32 // Records the passed profiled data, which should be a snapshot of the |
31 // browser's profiled performance during startup for a single process. | 33 // browser's profiled performance during startup for a single process. |
32 void RecordProfilerData( | 34 void RecordProfilerData( |
33 const tracked_objects::ProcessDataSnapshot& process_data, | 35 const tracked_objects::ProcessDataSnapshot& process_data, |
34 int process_type); | 36 int process_type); |
(...skipping 13 matching lines...) Expand all Loading... |
48 | 50 |
49 // Callback function used to get current network connection type. | 51 // Callback function used to get current network connection type. |
50 base::Callback<void(bool*)> cellular_callback_; | 52 base::Callback<void(bool*)> cellular_callback_; |
51 | 53 |
52 DISALLOW_COPY_AND_ASSIGN(ProfilerMetricsProvider); | 54 DISALLOW_COPY_AND_ASSIGN(ProfilerMetricsProvider); |
53 }; | 55 }; |
54 | 56 |
55 } // namespace metrics | 57 } // namespace metrics |
56 | 58 |
57 #endif // COMPONENTS_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ | 59 #endif // COMPONENTS_METRICS_PROFILER_PROFILER_METRICS_PROVIDER_H_ |
OLD | NEW |