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

Side by Side Diff: components/metrics/metrics_service.cc

Issue 441013002: Eliminate MetricsProvider::RecordCurrentState() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: last changes Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « components/metrics/metrics_provider.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 }
OLDNEW
« no previous file with comments | « components/metrics/metrics_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698