OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2015 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_HELPER_H_ | |
6 #define COMPONENTS_METRICS_STABILITY_METRICS_HELPER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/metrics/user_metrics.h" | |
10 #include "base/process/kill.h" | |
11 | |
12 class PrefRegistrySimple; | |
13 | |
Alexei Svitkine (slow)
2015/09/24 15:42:38
Nit: Remove empty line.
blundell
2015/09/24 16:15:31
Done.
| |
14 class PrefService; | |
15 | |
16 namespace metrics { | |
17 | |
18 class SystemProfileProto; | |
19 | |
20 // StabilityMetricsHelper is a class that providers functionality common to | |
21 // different embedders' stability metrics providers. | |
22 class StabilityMetricsHelper { | |
23 public: | |
24 explicit StabilityMetricsHelper(PrefService* local_state); | |
25 ~StabilityMetricsHelper(); | |
26 | |
27 // Provides stability metrics. | |
28 void ProvideStabilityMetrics(SystemProfileProto* system_profile_proto); | |
29 | |
30 // Clears the gathered stability metrics. | |
31 void ClearSavedStabilityMetrics(); | |
32 | |
33 // Records a browser child process crash. | |
34 void BrowserChildProcessCrashed(); | |
35 | |
36 // Logs the initiation of a page load. | |
37 void LogLoadStarted(); | |
38 | |
39 // Records a renderer process crash. | |
40 void LogRendererCrash(bool was_exception_process, | |
41 base::TerminationStatus status, | |
42 int exit_code); | |
43 | |
44 // Records a renderer process hang. | |
45 void LogRendererHang(); | |
46 | |
47 // Registers local state prefs used by this class. | |
48 static void RegisterPrefs(PrefRegistrySimple* registry); | |
49 | |
50 private: | |
51 // Increment an Integer pref value specified by |path|. | |
52 void IncrementPrefValue(const char* path); | |
53 | |
54 // Increment a 64-bit Integer pref value specified by |path|. | |
55 void IncrementLongPrefsValue(const char* path); | |
56 | |
57 PrefService* local_state_; | |
58 | |
59 DISALLOW_COPY_AND_ASSIGN(StabilityMetricsHelper); | |
60 }; | |
61 | |
62 } // namespace metrics | |
63 | |
64 #endif // COMPONENTS_METRICS_STABILITY_METRICS_HELPER_H_ | |
OLD | NEW |