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

Unified Diff: components/metrics/metrics_service.cc

Issue 2578363003: Inline RecordBooleanPrefValue to LogCleanShutdown. (Closed)
Patch Set: RecordCurrentState Created 4 years 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 | « components/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: components/metrics/metrics_service.cc
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index cc0e457e51e4199da6983a516c97ac5af987fe6e..12fc4084ba9fc5a384a0e0e7fc8b162201158d3e 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -446,13 +446,11 @@ void MetricsService::OnApplicationNotIdle() {
}
void MetricsService::RecordStartOfSessionEnd() {
- LogCleanShutdown();
- RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, false);
+ LogCleanShutdown(false);
}
void MetricsService::RecordCompletedSessionEnd() {
- LogCleanShutdown();
- RecordBooleanPrefValue(prefs::kStabilitySessionEndCompleted, true);
+ LogCleanShutdown(true);
}
#if defined(OS_ANDROID) || defined(OS_IOS)
@@ -1209,7 +1207,8 @@ void MetricsService::RecordCurrentStabilityHistograms() {
provider->RecordInitialHistogramSnapshots(&histogram_snapshot_manager_);
}
-void MetricsService::LogCleanShutdown() {
+void MetricsService::LogCleanShutdown(bool end_completed) {
+ DCHECK(IsSingleThreaded());
// 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).
clean_shutdown_status_ = CLEANLY_SHUTDOWN;
@@ -1217,11 +1216,7 @@ void MetricsService::LogCleanShutdown() {
clean_exit_beacon_.WriteBeaconValue(true);
RecordCurrentState(local_state_);
SetExecutionPhase(MetricsService::SHUTDOWN_COMPLETE, local_state_);
-}
-
-void MetricsService::RecordBooleanPrefValue(const char* path, bool value) {
- DCHECK(IsSingleThreaded());
- local_state_->SetBoolean(path, value);
+ local_state_->SetBoolean(prefs::kStabilitySessionEndCompleted, end_completed);
RecordCurrentState(local_state_);
}
« no previous file with comments | « components/metrics/metrics_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698