OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1714 } | 1714 } |
1715 return; | 1715 return; |
1716 } | 1716 } |
1717 } | 1717 } |
1718 | 1718 |
1719 SyntheticTrialGroup trial_group = trial; | 1719 SyntheticTrialGroup trial_group = trial; |
1720 trial_group.start_time = base::TimeTicks::Now(); | 1720 trial_group.start_time = base::TimeTicks::Now(); |
1721 synthetic_trial_groups_.push_back(trial_group); | 1721 synthetic_trial_groups_.push_back(trial_group); |
1722 } | 1722 } |
1723 | 1723 |
1724 void MetricsService::CheckForClonedInstall() { | 1724 void MetricsService::CheckForClonedInstall( |
1725 state_manager_->CheckForClonedInstall(); | 1725 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 1726 state_manager_->CheckForClonedInstall(task_runner); |
1726 } | 1727 } |
1727 | 1728 |
1728 void MetricsService::GetCurrentSyntheticFieldTrials( | 1729 void MetricsService::GetCurrentSyntheticFieldTrials( |
1729 std::vector<variations::ActiveGroupId>* synthetic_trials) { | 1730 std::vector<variations::ActiveGroupId>* synthetic_trials) { |
1730 DCHECK(synthetic_trials); | 1731 DCHECK(synthetic_trials); |
1731 synthetic_trials->clear(); | 1732 synthetic_trials->clear(); |
1732 const MetricsLog* current_log = | 1733 const MetricsLog* current_log = |
1733 static_cast<const MetricsLog*>(log_manager_.current_log()); | 1734 static_cast<const MetricsLog*>(log_manager_.current_log()); |
1734 for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { | 1735 for (size_t i = 0; i < synthetic_trial_groups_.size(); ++i) { |
1735 if (synthetic_trial_groups_[i].start_time <= current_log->creation_time()) | 1736 if (synthetic_trial_groups_[i].start_time <= current_log->creation_time()) |
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1954 if (metrics_service) | 1955 if (metrics_service) |
1955 metrics_service->AddObserver(observer); | 1956 metrics_service->AddObserver(observer); |
1956 } | 1957 } |
1957 | 1958 |
1958 void MetricsServiceHelper::RemoveMetricsServiceObserver( | 1959 void MetricsServiceHelper::RemoveMetricsServiceObserver( |
1959 MetricsServiceObserver* observer) { | 1960 MetricsServiceObserver* observer) { |
1960 MetricsService* metrics_service = g_browser_process->metrics_service(); | 1961 MetricsService* metrics_service = g_browser_process->metrics_service(); |
1961 if (metrics_service) | 1962 if (metrics_service) |
1962 metrics_service->RemoveObserver(observer); | 1963 metrics_service->RemoveObserver(observer); |
1963 } | 1964 } |
OLD | NEW |