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

Side by Side Diff: components/metrics/metrics_provider.h

Issue 558653002: Allow MetricsProviders to request an initial stability log. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Move all MetricsProvider implementation to .cc file. 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
« no previous file with comments | « components/metrics/BUILD.gn ('k') | components/metrics/metrics_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_METRICS_METRICS_PROVIDER_H_ 5 #ifndef COMPONENTS_METRICS_METRICS_PROVIDER_H_
6 #define COMPONENTS_METRICS_METRICS_PROVIDER_H_ 6 #define COMPONENTS_METRICS_METRICS_PROVIDER_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 9
10 namespace metrics { 10 namespace metrics {
11 11
12 class ChromeUserMetricsExtension; 12 class ChromeUserMetricsExtension;
13 class SystemProfileProto; 13 class SystemProfileProto;
14 class SystemProfileProto_Stability; 14 class SystemProfileProto_Stability;
15 15
16 // MetricsProvider is an interface allowing different parts of the UMA protos to 16 // MetricsProvider is an interface allowing different parts of the UMA protos to
17 // be filled out by different classes. 17 // be filled out by different classes.
18 class MetricsProvider { 18 class MetricsProvider {
19 public: 19 public:
20 MetricsProvider() {} 20 MetricsProvider();
21 virtual ~MetricsProvider() {} 21 virtual ~MetricsProvider();
22 22
23 // Called when a new MetricsLog is created. 23 // Called when a new MetricsLog is created.
24 virtual void OnDidCreateMetricsLog() {} 24 virtual void OnDidCreateMetricsLog();
25 25
26 // Called when metrics recording has been enabled. 26 // Called when metrics recording has been enabled.
27 virtual void OnRecordingEnabled() {} 27 virtual void OnRecordingEnabled();
28 28
29 // Called when metrics recording has been disabled. 29 // Called when metrics recording has been disabled.
30 virtual void OnRecordingDisabled() {} 30 virtual void OnRecordingDisabled();
31 31
32 // Provides additional metrics into the system profile. 32 // Provides additional metrics into the system profile.
33 virtual void ProvideSystemProfileMetrics( 33 virtual void ProvideSystemProfileMetrics(
34 SystemProfileProto* system_profile_proto) {} 34 SystemProfileProto* system_profile_proto);
35
36 // Called once at startup to see whether this provider has stability events
37 // to share. Default implementation always returns false.
38 virtual bool HasStabilityMetrics();
35 39
36 // Provides additional stability metrics. Stability metrics can be provided 40 // Provides additional stability metrics. Stability metrics can be provided
37 // directly into |stability_proto| fields or by logging stability histograms 41 // directly into |stability_proto| fields or by logging stability histograms
38 // via the UMA_STABILITY_HISTOGRAM_ENUMERATION() macro. 42 // via the UMA_STABILITY_HISTOGRAM_ENUMERATION() macro.
39 virtual void ProvideStabilityMetrics( 43 virtual void ProvideStabilityMetrics(
40 SystemProfileProto* system_profile_proto) {} 44 SystemProfileProto* system_profile_proto);
41 45
42 // Provides general metrics that are neither system profile nor stability 46 // Provides general metrics that are neither system profile nor stability
43 // metrics. 47 // metrics.
44 virtual void ProvideGeneralMetrics( 48 virtual void ProvideGeneralMetrics(
45 ChromeUserMetricsExtension* uma_proto) {} 49 ChromeUserMetricsExtension* uma_proto);
46 50
47 private: 51 private:
48 DISALLOW_COPY_AND_ASSIGN(MetricsProvider); 52 DISALLOW_COPY_AND_ASSIGN(MetricsProvider);
49 }; 53 };
50 54
51 } // namespace metrics 55 } // namespace metrics
52 56
53 #endif // COMPONENTS_METRICS_METRICS_PROVIDER_H_ 57 #endif // COMPONENTS_METRICS_METRICS_PROVIDER_H_
OLDNEW
« no previous file with comments | « components/metrics/BUILD.gn ('k') | components/metrics/metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698