| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ |
| 6 #define CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | 6 #define CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/metrics/user_metrics.h" | 9 #include "base/metrics/user_metrics.h" |
| 10 #include "base/process/kill.h" | 10 #include "base/process/kill.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 class ChromeStabilityMetricsProvider : public metrics::MetricsProvider, | 22 class ChromeStabilityMetricsProvider : public metrics::MetricsProvider, |
| 23 public content::NotificationObserver { | 23 public content::NotificationObserver { |
| 24 public: | 24 public: |
| 25 ChromeStabilityMetricsProvider(); | 25 ChromeStabilityMetricsProvider(); |
| 26 virtual ~ChromeStabilityMetricsProvider(); | 26 virtual ~ChromeStabilityMetricsProvider(); |
| 27 | 27 |
| 28 // metrics::MetricsDataProvider: | 28 // metrics::MetricsDataProvider: |
| 29 virtual void OnRecordingEnabled() OVERRIDE; | 29 virtual void OnRecordingEnabled() OVERRIDE; |
| 30 virtual void OnRecordingDisabled() OVERRIDE; | 30 virtual void OnRecordingDisabled() OVERRIDE; |
| 31 virtual void ProvideStabilityMetrics( | 31 virtual void ProvideStabilityMetrics( |
| 32 metrics::SystemProfileProto_Stability* stability_proto) OVERRIDE; | 32 metrics::SystemProfileProto* system_profile_proto) OVERRIDE; |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 // content::NotificationObserver: | 35 // content::NotificationObserver: |
| 36 virtual void Observe(int type, | 36 virtual void Observe(int type, |
| 37 const content::NotificationSource& source, | 37 const content::NotificationSource& source, |
| 38 const content::NotificationDetails& details) OVERRIDE; | 38 const content::NotificationDetails& details) OVERRIDE; |
| 39 | 39 |
| 40 // Logs the initiation of a page load and uses |web_contents| to do | 40 // Logs the initiation of a page load and uses |web_contents| to do |
| 41 // additional logging of the type of page loaded. | 41 // additional logging of the type of page loaded. |
| 42 void LogLoadStarted(content::WebContents* web_contents); | 42 void LogLoadStarted(content::WebContents* web_contents); |
| 43 | 43 |
| 44 // Records a renderer process crash. | 44 // Records a renderer process crash. |
| 45 void LogRendererCrash(content::RenderProcessHost* host, | 45 void LogRendererCrash(content::RenderProcessHost* host, |
| 46 base::TerminationStatus status, | 46 base::TerminationStatus status, |
| 47 int exit_code); | 47 int exit_code); |
| 48 | 48 |
| 49 // Records a renderer process hang. | 49 // Records a renderer process hang. |
| 50 void LogRendererHang(); | 50 void LogRendererHang(); |
| 51 | 51 |
| 52 // Registrar for receiving stability-related notifications. | 52 // Registrar for receiving stability-related notifications. |
| 53 content::NotificationRegistrar registrar_; | 53 content::NotificationRegistrar registrar_; |
| 54 | 54 |
| 55 DISALLOW_COPY_AND_ASSIGN(ChromeStabilityMetricsProvider); | 55 DISALLOW_COPY_AND_ASSIGN(ChromeStabilityMetricsProvider); |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 #endif // CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ | 58 #endif // CHROME_BROWSER_METRICS_CHROME_STABILITY_METRICS_PROVIDER_H_ |
| OLD | NEW |