Chromium Code Reviews| 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 "chrome/browser/metrics/chrome_stability_metrics_provider.h" | 5 #include "chrome/browser/metrics/chrome_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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 91 PrefService* pref = g_browser_process->local_state(); | 91 PrefService* pref = g_browser_process->local_state(); |
| 92 metrics::SystemProfileProto_Stability* stability_proto = | 92 metrics::SystemProfileProto_Stability* stability_proto = |
| 93 system_profile_proto->mutable_stability(); | 93 system_profile_proto->mutable_stability(); |
| 94 | 94 |
| 95 int count = pref->GetInteger(prefs::kStabilityPageLoadCount); | 95 int count = pref->GetInteger(prefs::kStabilityPageLoadCount); |
| 96 if (count) { | 96 if (count) { |
| 97 stability_proto->set_page_load_count(count); | 97 stability_proto->set_page_load_count(count); |
| 98 pref->SetInteger(prefs::kStabilityPageLoadCount, 0); | 98 pref->SetInteger(prefs::kStabilityPageLoadCount, 0); |
| 99 } | 99 } |
| 100 | 100 |
| 101 count = pref->GetInteger(prefs::kStabilityChildProcessCrashCount); | |
|
blundell
2014/05/27 15:55:49
This code should have been moved here when ChromeS
| |
| 102 if (count) { | |
| 103 stability_proto->set_child_process_crash_count(count); | |
| 104 pref->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); | |
| 105 } | |
| 106 | |
| 101 count = pref->GetInteger(prefs::kStabilityRendererCrashCount); | 107 count = pref->GetInteger(prefs::kStabilityRendererCrashCount); |
| 102 if (count) { | 108 if (count) { |
| 103 stability_proto->set_renderer_crash_count(count); | 109 stability_proto->set_renderer_crash_count(count); |
| 104 pref->SetInteger(prefs::kStabilityRendererCrashCount, 0); | 110 pref->SetInteger(prefs::kStabilityRendererCrashCount, 0); |
| 105 } | 111 } |
| 106 | 112 |
| 107 count = pref->GetInteger(prefs::kStabilityExtensionRendererCrashCount); | 113 count = pref->GetInteger(prefs::kStabilityExtensionRendererCrashCount); |
| 108 if (count) { | 114 if (count) { |
| 109 stability_proto->set_extension_renderer_crash_count(count); | 115 stability_proto->set_extension_renderer_crash_count(count); |
| 110 pref->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0); | 116 pref->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 was_extension_process ? 2 : 1); | 219 was_extension_process ? 2 : 1); |
| 214 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { | 220 } else if (status == base::TERMINATION_STATUS_STILL_RUNNING) { |
| 215 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", | 221 UMA_HISTOGRAM_PERCENTAGE("BrowserRenderProcessHost.DisconnectedAlive", |
| 216 was_extension_process ? 2 : 1); | 222 was_extension_process ? 2 : 1); |
| 217 } | 223 } |
| 218 } | 224 } |
| 219 | 225 |
| 220 void ChromeStabilityMetricsProvider::LogRendererHang() { | 226 void ChromeStabilityMetricsProvider::LogRendererHang() { |
| 221 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 227 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
| 222 } | 228 } |
| OLD | NEW |