OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 //------------------------------------------------------------------------------ | 5 //------------------------------------------------------------------------------ |
6 // Description of the life cycle of a instance of MetricsService. | 6 // Description of the life cycle of a instance of MetricsService. |
7 // | 7 // |
8 // OVERVIEW | 8 // OVERVIEW |
9 // | 9 // |
10 // A MetricsService instance is typically created at application startup. It | 10 // A MetricsService instance is typically created at application startup. It |
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1224 } | 1224 } |
1225 | 1225 |
1226 { | 1226 { |
1227 ListPrefUpdate update(local_state, prefs::kMetricsOngoingLogs); | 1227 ListPrefUpdate update(local_state, prefs::kMetricsOngoingLogs); |
1228 ListValue* unsent_ongoing_logs = update.Get(); | 1228 ListValue* unsent_ongoing_logs = update.Get(); |
1229 StoreUnsentLogsHelper(unsent_ongoing_logs_, kMaxOngoingLogsPersisted, | 1229 StoreUnsentLogsHelper(unsent_ongoing_logs_, kMaxOngoingLogsPersisted, |
1230 unsent_ongoing_logs); | 1230 unsent_ongoing_logs); |
1231 } | 1231 } |
1232 } | 1232 } |
1233 | 1233 |
1234 void MetricsService::LogCleanShutdown() { | |
1235 RecordBooleanPrefValue(prefs::kStabilityExitedCleanly, true); | |
jar (doing other things)
2011/06/29 04:00:09
Two things: I think this should ONLY be called on
| |
1236 } | |
1237 | |
1234 void MetricsService::PreparePendingLogText() { | 1238 void MetricsService::PreparePendingLogText() { |
1235 DCHECK(pending_log()); | 1239 DCHECK(pending_log()); |
1236 if (!compressed_log_.empty()) | 1240 if (!compressed_log_.empty()) |
1237 return; | 1241 return; |
1238 int text_size = pending_log_->GetEncodedLogSize(); | 1242 int text_size = pending_log_->GetEncodedLogSize(); |
1239 | 1243 |
1240 std::string pending_log_text; | 1244 std::string pending_log_text; |
1241 // Leave room for the NULL terminator. | 1245 // Leave room for the NULL terminator. |
1242 pending_log_->GetEncodedLog(WriteInto(&pending_log_text, text_size + 1), | 1246 pending_log_->GetEncodedLog(WriteInto(&pending_log_text, text_size + 1), |
1243 text_size); | 1247 text_size); |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1473 } | 1477 } |
1474 | 1478 |
1475 void MetricsService::LogExtensionRendererCrash() { | 1479 void MetricsService::LogExtensionRendererCrash() { |
1476 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); | 1480 IncrementPrefValue(prefs::kStabilityExtensionRendererCrashCount); |
1477 } | 1481 } |
1478 | 1482 |
1479 void MetricsService::LogRendererHang() { | 1483 void MetricsService::LogRendererHang() { |
1480 IncrementPrefValue(prefs::kStabilityRendererHangCount); | 1484 IncrementPrefValue(prefs::kStabilityRendererHangCount); |
1481 } | 1485 } |
1482 | 1486 |
1483 void MetricsService::LogCleanShutdown() { | |
1484 RecordBooleanPrefValue(prefs::kStabilityExitedCleanly, true); | |
1485 } | |
1486 | |
1487 #if defined(OS_CHROMEOS) | 1487 #if defined(OS_CHROMEOS) |
1488 void MetricsService::LogChromeOSCrash(const std::string &crash_type) { | 1488 void MetricsService::LogChromeOSCrash(const std::string &crash_type) { |
1489 if (crash_type == "user") | 1489 if (crash_type == "user") |
1490 IncrementPrefValue(prefs::kStabilityOtherUserCrashCount); | 1490 IncrementPrefValue(prefs::kStabilityOtherUserCrashCount); |
1491 else if (crash_type == "kernel") | 1491 else if (crash_type == "kernel") |
1492 IncrementPrefValue(prefs::kStabilityKernelCrashCount); | 1492 IncrementPrefValue(prefs::kStabilityKernelCrashCount); |
1493 else if (crash_type == "uncleanshutdown") | 1493 else if (crash_type == "uncleanshutdown") |
1494 IncrementPrefValue(prefs::kStabilitySystemUncleanShutdownCount); | 1494 IncrementPrefValue(prefs::kStabilitySystemUncleanShutdownCount); |
1495 else | 1495 else |
1496 NOTREACHED() << "Unexpected Chrome OS crash type " << crash_type; | 1496 NOTREACHED() << "Unexpected Chrome OS crash type " << crash_type; |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1694 thread_id = base::PlatformThread::CurrentId(); | 1694 thread_id = base::PlatformThread::CurrentId(); |
1695 return base::PlatformThread::CurrentId() == thread_id; | 1695 return base::PlatformThread::CurrentId() == thread_id; |
1696 } | 1696 } |
1697 | 1697 |
1698 #if defined(OS_CHROMEOS) | 1698 #if defined(OS_CHROMEOS) |
1699 void MetricsService::StartExternalMetrics() { | 1699 void MetricsService::StartExternalMetrics() { |
1700 external_metrics_ = new chromeos::ExternalMetrics; | 1700 external_metrics_ = new chromeos::ExternalMetrics; |
1701 external_metrics_->Start(); | 1701 external_metrics_->Start(); |
1702 } | 1702 } |
1703 #endif | 1703 #endif |
OLD | NEW |