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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1038 | 1038 |
1039 SyntheticTrialGroup trial_group = trial; | 1039 SyntheticTrialGroup trial_group = trial; |
1040 trial_group.start_time = base::TimeTicks::Now(); | 1040 trial_group.start_time = base::TimeTicks::Now(); |
1041 synthetic_trial_groups_.push_back(trial_group); | 1041 synthetic_trial_groups_.push_back(trial_group); |
1042 NotifySyntheticTrialObservers(); | 1042 NotifySyntheticTrialObservers(); |
1043 } | 1043 } |
1044 | 1044 |
1045 void MetricsService::RegisterMetricsProvider( | 1045 void MetricsService::RegisterMetricsProvider( |
1046 scoped_ptr<MetricsProvider> provider) { | 1046 scoped_ptr<MetricsProvider> provider) { |
1047 DCHECK_EQ(INITIALIZED, state_); | 1047 DCHECK_EQ(INITIALIZED, state_); |
1048 metrics_providers_.push_back(provider.release()); | 1048 metrics_providers_.push_back(provider.Pass()); |
1049 } | 1049 } |
1050 | 1050 |
1051 void MetricsService::CheckForClonedInstall( | 1051 void MetricsService::CheckForClonedInstall( |
1052 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 1052 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
1053 state_manager_->CheckForClonedInstall(task_runner); | 1053 state_manager_->CheckForClonedInstall(task_runner); |
1054 } | 1054 } |
1055 | 1055 |
1056 void MetricsService::NotifySyntheticTrialObservers() { | 1056 void MetricsService::NotifySyntheticTrialObservers() { |
1057 FOR_EACH_OBSERVER(SyntheticTrialObserver, synthetic_trial_observer_list_, | 1057 FOR_EACH_OBSERVER(SyntheticTrialObserver, synthetic_trial_observer_list_, |
1058 OnSyntheticTrialsChanged(synthetic_trial_groups_)); | 1058 OnSyntheticTrialsChanged(synthetic_trial_groups_)); |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1121 local_state_->SetBoolean(path, value); | 1121 local_state_->SetBoolean(path, value); |
1122 RecordCurrentState(local_state_); | 1122 RecordCurrentState(local_state_); |
1123 } | 1123 } |
1124 | 1124 |
1125 void MetricsService::RecordCurrentState(PrefService* pref) { | 1125 void MetricsService::RecordCurrentState(PrefService* pref) { |
1126 pref->SetInt64(prefs::kStabilityLastTimestampSec, | 1126 pref->SetInt64(prefs::kStabilityLastTimestampSec, |
1127 base::Time::Now().ToTimeT()); | 1127 base::Time::Now().ToTimeT()); |
1128 } | 1128 } |
1129 | 1129 |
1130 } // namespace metrics | 1130 } // namespace metrics |
OLD | NEW |