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 1129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1140 DCHECK_EQ(INITIALIZED, state_); | 1140 DCHECK_EQ(INITIALIZED, state_); |
1141 metrics_providers_.push_back(std::move(provider)); | 1141 metrics_providers_.push_back(std::move(provider)); |
1142 } | 1142 } |
1143 | 1143 |
1144 void MetricsService::CheckForClonedInstall( | 1144 void MetricsService::CheckForClonedInstall( |
1145 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 1145 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
1146 state_manager_->CheckForClonedInstall(task_runner); | 1146 state_manager_->CheckForClonedInstall(task_runner); |
1147 } | 1147 } |
1148 | 1148 |
1149 void MetricsService::NotifySyntheticTrialObservers() { | 1149 void MetricsService::NotifySyntheticTrialObservers() { |
1150 FOR_EACH_OBSERVER(variations::SyntheticTrialObserver, | 1150 for (variations::SyntheticTrialObserver& observer : |
1151 synthetic_trial_observer_list_, | 1151 synthetic_trial_observer_list_) { |
1152 OnSyntheticTrialsChanged(synthetic_trial_groups_)); | 1152 observer.OnSyntheticTrialsChanged(synthetic_trial_groups_); |
| 1153 } |
1153 } | 1154 } |
1154 | 1155 |
1155 void MetricsService::GetSyntheticFieldTrialsOlderThan( | 1156 void MetricsService::GetSyntheticFieldTrialsOlderThan( |
1156 base::TimeTicks time, | 1157 base::TimeTicks time, |
1157 std::vector<variations::ActiveGroupId>* synthetic_trials) { | 1158 std::vector<variations::ActiveGroupId>* synthetic_trials) { |
1158 DCHECK(synthetic_trials); | 1159 DCHECK(synthetic_trials); |
1159 synthetic_trials->clear(); | 1160 synthetic_trials->clear(); |
1160 for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { | 1161 for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { |
1161 if (synthetic_trial_groups_[i].start_time <= time) | 1162 if (synthetic_trial_groups_[i].start_time <= time) |
1162 synthetic_trials->push_back(synthetic_trial_groups_[i].id); | 1163 synthetic_trials->push_back(synthetic_trial_groups_[i].id); |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1222 base::Time::Now().ToTimeT()); | 1223 base::Time::Now().ToTimeT()); |
1223 } | 1224 } |
1224 | 1225 |
1225 void MetricsService::SkipAndDiscardUpload() { | 1226 void MetricsService::SkipAndDiscardUpload() { |
1226 log_manager_.DiscardStagedLog(); | 1227 log_manager_.DiscardStagedLog(); |
1227 scheduler_->UploadCancelled(); | 1228 scheduler_->UploadCancelled(); |
1228 log_upload_in_progress_ = false; | 1229 log_upload_in_progress_ = false; |
1229 } | 1230 } |
1230 | 1231 |
1231 } // namespace metrics | 1232 } // namespace metrics |
OLD | NEW |