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