OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2014 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 CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | |
6 #define CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | |
7 | |
8 #include "base/basictypes.h" | |
9 #include "base/metrics/user_metrics.h" | |
10 #include "base/process/kill.h" | |
11 #include "components/metrics/metrics_provider.h" | |
12 #include "components/metrics/proto/chrome_user_metrics_extension.pb.h" | |
13 #include "content/public/browser/notification_observer.h" | |
14 #include "content/public/browser/notification_registrar.h" | |
15 | |
16 namespace content { | |
17 class RenderProcessHost; | |
18 class WebContents; | |
19 } | |
20 | |
21 // ChromeStabilityMetricsProvider gathers and logs Chrome-specific stability- | |
22 // related metrics. | |
23 class ChromeStabilityMetricsProvider : public metrics::MetricsProvider, | |
24 public content::NotificationObserver { | |
25 public: | |
26 ChromeStabilityMetricsProvider(); | |
27 virtual ~ChromeStabilityMetricsProvider(); | |
28 | |
29 // metrics::MetricsDataProvider: | |
30 virtual void OnRecordingEnabled() OVERRIDE; | |
31 virtual void OnRecordingDisabled() OVERRIDE; | |
32 virtual void ProvideStabilityMetrics( | |
33 metrics::SystemProfileProto_Stability* stability_proto) OVERRIDE; | |
34 | |
35 private: | |
36 // content::NotificationObserver: | |
37 virtual void Observe(int type, | |
38 const content::NotificationSource& source, | |
39 const content::NotificationDetails& details) OVERRIDE; | |
40 | |
41 // Logs the initiation of a page load and uses |web_contents| to do | |
42 // additional logging of the type of page loaded. | |
43 void LogLoadStarted(content::WebContents* web_contents); | |
44 | |
45 // Records a renderer process crash. | |
46 void LogRendererCrash(content::RenderProcessHost* host, | |
47 base::TerminationStatus status, | |
48 int exit_code); | |
49 | |
50 // Records a renderer process hang. | |
51 void LogRendererHang(); | |
52 | |
53 // Registrar for receiving stability-related notifications. | |
54 content::NotificationRegistrar registrar_; | |
55 | |
56 // TODO(blundell): Is this needed? | |
Alexei Svitkine (slow)
2014/05/21 15:02:29
I don't think it is in this case.
blundell
2014/05/21 15:14:17
Done.
| |
57 // Saved cache of generated Stability event protos, to be copied into the UMA | |
58 // proto when ProvideGeneralMetrics() is called. | |
59 metrics::ChromeUserMetricsExtension omnibox_events_cache; | |
60 | |
61 DISALLOW_COPY_AND_ASSIGN(ChromeStabilityMetricsProvider); | |
62 }; | |
63 | |
64 #endif // CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | |
OLD | NEW |