Chromium Code Reviews| Index: chrome/browser/metrics/metrics_service.cc |
| diff --git a/chrome/browser/metrics/metrics_service.cc b/chrome/browser/metrics/metrics_service.cc |
| index 313de569207cbf3824c3368dcc2de80454acfef5..51e09021e0dad67f7883a2d5ba59c990f4e643e1 100644 |
| --- a/chrome/browser/metrics/metrics_service.cc |
| +++ b/chrome/browser/metrics/metrics_service.cc |
| @@ -737,13 +737,11 @@ void MetricsService::HandleIdleSinceLastTransmission(bool in_idle) { |
| } |
| void MetricsService::RecordStartOfSessionEnd() { |
| - LogCleanShutdown(); |
| - RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, false); |
| + RecordStabilitySessionEndCompleted(false); |
| } |
| void MetricsService::RecordCompletedSessionEnd() { |
| - LogCleanShutdown(); |
| - RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, true); |
| + RecordStabilitySessionEndCompleted(true); |
| } |
| #if defined(OS_ANDROID) || defined(OS_IOS) |
| @@ -1598,23 +1596,21 @@ void MetricsService::LogRendererHang() { |
| IncrementPrefValue(prefs::kStabilityRendererHangCount); |
| } |
| +void MetricsService::RecordStabilitySessionEndCompleted(bool value) { |
| + PrefService* pref = g_browser_process->local_state(); |
| + DCHECK(pref); |
| + clean_shutdown_status_ = CLEANLY_SHUTDOWN; |
| + pref->SetBoolean(prefs::kStabilitySessionEndCompleted, value); |
| + RecordCurrentState(pref); |
|
Ilya Sherman
2013/10/04 03:26:59
Btw, why did you inline the call to RecordBooleanP
oshima
2013/10/04 06:03:14
Because it's calling RecordCurrentState(pref) insi
|
| + MarkAppCleanShutdownAndCommit(); |
| +} |
| + |
| bool MetricsService::UmaMetricsProperlyShutdown() { |
| CHECK(clean_shutdown_status_ == CLEANLY_SHUTDOWN || |
| clean_shutdown_status_ == NEED_TO_SHUTDOWN); |
| return clean_shutdown_status_ == CLEANLY_SHUTDOWN; |
| } |
| -void MetricsService::LogCleanShutdown() { |
| - // Redundant hack to write pref ASAP. |
| - MarkAppCleanShutdownAndCommit(); |
| - |
| - // Redundant setting to assure that we always reset this value at shutdown |
| - // (and that we don't use some alternate path, and not call LogCleanShutdown). |
|
Ilya Sherman
2013/10/04 03:26:59
What happened to this comment? Is it no longer re
oshima
2013/10/04 06:03:14
Added back. Thank you for pointing out.
|
| - clean_shutdown_status_ = CLEANLY_SHUTDOWN; |
| - |
| - RecordBooleanPrefValue(prefs::kStabilityExitedCleanly, true); |
| -} |
| - |
| #if defined(OS_CHROMEOS) |
| void MetricsService::LogChromeOSCrash(const std::string &crash_type) { |
| if (crash_type == "user") |