| OLD | NEW |
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_METRICS_STABILITY_METRICS_PROVIDER_H_ |
| 6 #define COMPONENTS_METRICS_STABILITY_METRICS_PROVIDER_H_ |
| 7 |
| 8 #include "components/metrics/metrics_provider.h" |
| 9 |
| 10 class PrefService; |
| 11 class PrefRegistrySimple; |
| 12 |
| 13 namespace metrics { |
| 14 |
| 15 class SystemProfileProto; |
| 16 |
| 17 // Stores and loads system information to prefs for stability logs. |
| 18 class StabilityMetricsProvider : public MetricsProvider { |
| 19 public: |
| 20 StabilityMetricsProvider(PrefService* local_state); |
| 21 ~StabilityMetricsProvider() override; |
| 22 |
| 23 static void RegisterPrefs(PrefRegistrySimple* registry); |
| 24 |
| 25 void RecordBreakpadRegistration(bool success); |
| 26 void RecordBreakpadHasDebugger(bool has_debugger); |
| 27 |
| 28 void CheckLastSessionEndCompleted(); |
| 29 void MarkSessionEndCompleted(bool end_completed); |
| 30 |
| 31 void LogCrash(); |
| 32 void LogStabilityLogDeferred(); |
| 33 void LogStabilityDataDiscarded(); |
| 34 void LogLaunch(); |
| 35 void LogStabilityVersionMismatch(); |
| 36 |
| 37 private: |
| 38 // Increments an Integer pref value specified by |path|. |
| 39 void IncrementPrefValue(const char* path); |
| 40 |
| 41 // MetricsProvider: |
| 42 void ClearSavedStabilityMetrics() override; |
| 43 void ProvideStabilityMetrics( |
| 44 SystemProfileProto* system_profile_proto) override; |
| 45 |
| 46 PrefService* local_state_; |
| 47 |
| 48 DISALLOW_COPY_AND_ASSIGN(StabilityMetricsProvider); |
| 49 }; |
| 50 |
| 51 } // namespace metrics |
| 52 |
| 53 #endif // COMPONENTS_METRICS_STABILITY_METRICS_PROVIDER_H_ |
| OLD | NEW |