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 #include "chromecast/browser/metrics/cast_stability_metrics_provider.h" | 5 #include "chromecast/browser/metrics/cast_stability_metrics_provider.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 LogRendererHang(); | 133 LogRendererHang(); |
134 break; | 134 break; |
135 | 135 |
136 default: | 136 default: |
137 NOTREACHED(); | 137 NOTREACHED(); |
138 break; | 138 break; |
139 } | 139 } |
140 } | 140 } |
141 | 141 |
142 void CastStabilityMetricsProvider::BrowserChildProcessCrashed( | 142 void CastStabilityMetricsProvider::BrowserChildProcessCrashed( |
143 const content::ChildProcessData& data) { | 143 const content::ChildProcessData& data, |
| 144 int exit_code) { |
144 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); | 145 IncrementPrefValue(prefs::kStabilityChildProcessCrashCount); |
145 } | 146 } |
146 | 147 |
147 void CastStabilityMetricsProvider::LogRendererCrash( | 148 void CastStabilityMetricsProvider::LogRendererCrash( |
148 content::RenderProcessHost* host, | 149 content::RenderProcessHost* host, |
149 base::TerminationStatus status, | 150 base::TerminationStatus status, |
150 int exit_code) { | 151 int exit_code) { |
151 if (status == base::TERMINATION_STATUS_PROCESS_CRASHED || | 152 if (status == base::TERMINATION_STATUS_PROCESS_CRASHED || |
152 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { | 153 status == base::TERMINATION_STATUS_ABNORMAL_TERMINATION) { |
153 IncrementPrefValue(prefs::kStabilityRendererCrashCount); | 154 IncrementPrefValue(prefs::kStabilityRendererCrashCount); |
154 | 155 |
155 UMA_HISTOGRAM_SPARSE_SLOWLY("CrashExitCodes.Renderer", | 156 UMA_HISTOGRAM_SPARSE_SLOWLY("CrashExitCodes.Renderer", |
156 MapCrashExitCodeForHistogram(exit_code)); | 157 MapCrashExitCodeForHistogram(exit_code)); |
157 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", 1); | 158 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildCrashes", 1); |
158 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { | 159 } else if (status == base::TERMINATION_STATUS_PROCESS_WAS_KILLED) { |
159 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildKills", 1); | 160 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.ChildKills", 1); |
160 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { | 161 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
161 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", 1); | 162 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", 1); |
162 } | 163 } |
163 } | 164 } |
164 | 165 |
165 void CastStabilityMetricsProvider::LogRendererHang() { | 166 void CastStabilityMetricsProvider::LogRendererHang() { |
166 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 167 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
167 } | 168 } |
168 | 169 |
169 } // namespace metrics | 170 } // namespace metrics |
170 } // namespace chromecast | 171 } // namespace chromecast |
OLD | NEW |