1 // Copyright 2014 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "components/metrics/metrics_provider.h"
7 #include "base/notreached.h"
8 #include "third_party/metrics_proto/chrome_user_metrics_extension.pb.h"
12 MetricsProvider::MetricsProvider() {
15 MetricsProvider::~MetricsProvider() {
18 void MetricsProvider::Init() {
21 void MetricsProvider::AsyncInit(base::OnceClosure done_callback) {
22 std::move(done_callback).Run();
25 bool MetricsProvider::ProvideHistograms() {
29 void MetricsProvider::OnDidCreateMetricsLog() {
30 emitted_ = ProvideHistograms();
33 void MetricsProvider::OnRecordingEnabled() {
36 void MetricsProvider::OnRecordingDisabled() {
39 void MetricsProvider::OnClientStateCleared() {}
41 void MetricsProvider::OnAppEnterBackground() {
44 bool MetricsProvider::HasIndependentMetrics() {
48 void MetricsProvider::ProvideIndependentMetrics(
49 base::OnceClosure serialize_log_callback,
50 base::OnceCallback<void(bool)> done_callback,
51 ChromeUserMetricsExtension* uma_proto,
52 base::HistogramSnapshotManager* snapshot_manager) {
53 // Either the method HasIndependentMetrics() has been overridden and this
54 // method has not, or this method being called without regard to Has().
59 void MetricsProvider::ProvideSystemProfileMetrics(
60 SystemProfileProto* system_profile_proto) {}
62 void MetricsProvider::ProvideSystemProfileMetricsWithLogCreationTime(
63 base::TimeTicks log_creation_time,
64 SystemProfileProto* system_profile_proto) {
65 ProvideSystemProfileMetrics(system_profile_proto);
68 bool MetricsProvider::HasPreviousSessionData() {
72 void MetricsProvider::ProvidePreviousSessionData(
73 ChromeUserMetricsExtension* uma_proto) {
74 ProvideStabilityMetrics(uma_proto->mutable_system_profile());
77 void MetricsProvider::ProvideCurrentSessionData(
78 ChromeUserMetricsExtension* uma_proto) {
79 ProvideStabilityMetrics(uma_proto->mutable_system_profile());
86 void MetricsProvider::ProvideCurrentSessionUKMData() {}
88 void MetricsProvider::ProvideStabilityMetrics(
89 SystemProfileProto* system_profile_proto) {
92 void MetricsProvider::ClearSavedStabilityMetrics() {
95 void MetricsProvider::RecordHistogramSnapshots(
96 base::HistogramSnapshotManager* snapshot_manager) {
99 void MetricsProvider::RecordInitialHistogramSnapshots(
100 base::HistogramSnapshotManager* snapshot_manager) {
103 } // namespace metrics