| 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 CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ | 5 #ifndef CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ |
| 6 #define CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ | 6 #define CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/process/kill.h" | 9 #include "base/process/kill.h" |
| 10 #include "components/metrics/metrics_provider.h" | 10 #include "components/metrics/metrics_provider.h" |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 void LogExternalCrash(const std::string& crash_type); | 50 void LogExternalCrash(const std::string& crash_type); |
| 51 | 51 |
| 52 private: | 52 private: |
| 53 // content::NotificationObserver implementation: | 53 // content::NotificationObserver implementation: |
| 54 void Observe(int type, | 54 void Observe(int type, |
| 55 const content::NotificationSource& source, | 55 const content::NotificationSource& source, |
| 56 const content::NotificationDetails& details) override; | 56 const content::NotificationDetails& details) override; |
| 57 | 57 |
| 58 // content::BrowserChildProcessObserver implementation: | 58 // content::BrowserChildProcessObserver implementation: |
| 59 void BrowserChildProcessCrashed( | 59 void BrowserChildProcessCrashed( |
| 60 const content::ChildProcessData& data) override; | 60 const content::ChildProcessData& data, |
| 61 int exit_code) override; |
| 61 | 62 |
| 62 // Records a renderer process crash. | 63 // Records a renderer process crash. |
| 63 void LogRendererCrash(content::RenderProcessHost* host, | 64 void LogRendererCrash(content::RenderProcessHost* host, |
| 64 base::TerminationStatus status, | 65 base::TerminationStatus status, |
| 65 int exit_code); | 66 int exit_code); |
| 66 | 67 |
| 67 // Records a renderer process hang. | 68 // Records a renderer process hang. |
| 68 void LogRendererHang(); | 69 void LogRendererHang(); |
| 69 | 70 |
| 70 // Registrar for receiving stability-related notifications. | 71 // Registrar for receiving stability-related notifications. |
| 71 content::NotificationRegistrar registrar_; | 72 content::NotificationRegistrar registrar_; |
| 72 | 73 |
| 73 // Reference to the current MetricsService. Raw pointer is safe, since | 74 // Reference to the current MetricsService. Raw pointer is safe, since |
| 74 // MetricsService is responsible for the lifetime of | 75 // MetricsService is responsible for the lifetime of |
| 75 // CastStabilityMetricsProvider. | 76 // CastStabilityMetricsProvider. |
| 76 ::metrics::MetricsService* metrics_service_; | 77 ::metrics::MetricsService* metrics_service_; |
| 77 | 78 |
| 78 DISALLOW_COPY_AND_ASSIGN(CastStabilityMetricsProvider); | 79 DISALLOW_COPY_AND_ASSIGN(CastStabilityMetricsProvider); |
| 79 }; | 80 }; |
| 80 | 81 |
| 81 } // namespace metrics | 82 } // namespace metrics |
| 82 } // namespace chromecast | 83 } // namespace chromecast |
| 83 | 84 |
| 84 #endif // CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ | 85 #endif // CHROMECAST_BROWSER_METRICS_CAST_STABILITY_METRICS_PROVIDER_H_ |
| OLD | NEW |