| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "components/metrics/stability_metrics_helper.h" | 5 #include "components/metrics/stability_metrics_helper.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 local_state_->SetInteger( | 115 local_state_->SetInteger( |
| 116 prefs::kStabilityExtensionRendererFailedLaunchCount, 0); | 116 prefs::kStabilityExtensionRendererFailedLaunchCount, 0); |
| 117 } | 117 } |
| 118 | 118 |
| 119 count = local_state_->GetInteger(prefs::kStabilityRendererHangCount); | 119 count = local_state_->GetInteger(prefs::kStabilityRendererHangCount); |
| 120 if (count) { | 120 if (count) { |
| 121 stability_proto->set_renderer_hang_count(count); | 121 stability_proto->set_renderer_hang_count(count); |
| 122 local_state_->SetInteger(prefs::kStabilityRendererHangCount, 0); | 122 local_state_->SetInteger(prefs::kStabilityRendererHangCount, 0); |
| 123 } | 123 } |
| 124 | 124 |
| 125 count = local_state_->GetInteger(prefs::kStabilityRendererLaunchCount); | 125 count = |
| 126 local_state_->GetInteger(prefs::kStabilityExtensionRendererLaunchCount); |
| 126 if (count) { | 127 if (count) { |
| 127 stability_proto->set_renderer_launch_count(count); | 128 stability_proto->set_extension_renderer_launch_count(count); |
| 128 local_state_->SetInteger(prefs::kStabilityRendererLaunchCount, 0); | 129 local_state_->SetInteger(prefs::kStabilityExtensionRendererLaunchCount, 0); |
| 129 } | 130 } |
| 130 } | 131 } |
| 131 | 132 |
| 132 void StabilityMetricsHelper::ClearSavedStabilityMetrics() { | 133 void StabilityMetricsHelper::ClearSavedStabilityMetrics() { |
| 133 // Clear all the prefs used in this class in UMA reports (which doesn't | 134 // Clear all the prefs used in this class in UMA reports (which doesn't |
| 134 // include |kUninstallMetricsPageLoadCount| as it's not sent up by UMA). | 135 // include |kUninstallMetricsPageLoadCount| as it's not sent up by UMA). |
| 135 local_state_->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); | 136 local_state_->SetInteger(prefs::kStabilityChildProcessCrashCount, 0); |
| 136 local_state_->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0); | 137 local_state_->SetInteger(prefs::kStabilityExtensionRendererCrashCount, 0); |
| 137 local_state_->SetInteger(prefs::kStabilityExtensionRendererFailedLaunchCount, | 138 local_state_->SetInteger(prefs::kStabilityExtensionRendererFailedLaunchCount, |
| 138 0); | 139 0); |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 void StabilityMetricsHelper::IncrementLongPrefsValue(const char* path) { | 239 void StabilityMetricsHelper::IncrementLongPrefsValue(const char* path) { |
| 239 int64_t value = local_state_->GetInt64(path); | 240 int64_t value = local_state_->GetInt64(path); |
| 240 local_state_->SetInt64(path, value + 1); | 241 local_state_->SetInt64(path, value + 1); |
| 241 } | 242 } |
| 242 | 243 |
| 243 void StabilityMetricsHelper::LogRendererHang() { | 244 void StabilityMetricsHelper::LogRendererHang() { |
| 244 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 245 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
| 245 } | 246 } |
| 246 | 247 |
| 247 } // namespace metrics | 248 } // namespace metrics |
| OLD | NEW |