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

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

Issue 1366643002: Extract guts of ChromeStabilityMetricsProvider into helper class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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 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_
OLDNEW
« no previous file with comments | « components/metrics/metrics_pref_names.cc ('k') | components/metrics/stability_metrics_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698