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

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

Issue 2687393004: Gather stability prefs into managing objects. (Closed)
Patch Set: Incorporate Feedback Created 3 years, 10 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
OLDNEW
(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_
OLDNEW
« no previous file with comments | « components/metrics/metrics_service_unittest.cc ('k') | components/metrics/stability_metrics_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698