| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 is | 10 // A MetricsService instance is typically created at application startup. It is |
| (...skipping 1190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1201 | 1201 |
| 1202 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { | 1202 void MetricsService::RecordBooleanPrefValue(const char* path, bool value) { |
| 1203 DCHECK(IsSingleThreaded()); | 1203 DCHECK(IsSingleThreaded()); |
| 1204 local_state_->SetBoolean(path, value); | 1204 local_state_->SetBoolean(path, value); |
| 1205 RecordCurrentState(local_state_); | 1205 RecordCurrentState(local_state_); |
| 1206 } | 1206 } |
| 1207 | 1207 |
| 1208 void MetricsService::RecordCurrentState(PrefService* pref) { | 1208 void MetricsService::RecordCurrentState(PrefService* pref) { |
| 1209 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, | 1209 pref->SetInt64(metrics::prefs::kStabilityLastTimestampSec, |
| 1210 Time::Now().ToTimeT()); | 1210 Time::Now().ToTimeT()); |
| 1211 | |
| 1212 for (size_t i = 0; i < metrics_providers_.size(); ++i) | |
| 1213 metrics_providers_[i]->RecordCurrentState(); | |
| 1214 } | 1211 } |
| OLD | NEW |