Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4510)

Unified Diff: chrome/browser/metrics/metrics_service.cc

Issue 25484004: Don't commit prefs::kStabilitySessionEndCompleted change immediately on chromeos (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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")
« no previous file with comments | « chrome/browser/metrics/metrics_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698