OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // FieldTrial is a class for handling details of statistical experiments | 5 // FieldTrial is a class for handling details of statistical experiments |
6 // performed by actual users in the field (i.e., in a shipped or beta product). | 6 // performed by actual users in the field (i.e., in a shipped or beta product). |
7 // All code is called exclusively on the UI thread currently. | 7 // All code is called exclusively on the UI thread currently. |
8 // | 8 // |
9 // The simplest example is a test to see whether one of two options produces | 9 // The simplest example is a test to see whether one of two options produces |
10 // "better" results across our user population. In that scenario, UMA data | 10 // "better" results across our user population. In that scenario, UMA data |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 static base::Time application_start_time() { | 73 static base::Time application_start_time() { |
74 if (global_) | 74 if (global_) |
75 return global_->application_start_time_; | 75 return global_->application_start_time_; |
76 // For testing purposes only, or when we don't yet have a start time. | 76 // For testing purposes only, or when we don't yet have a start time. |
77 return base::Time::Now(); | 77 return base::Time::Now(); |
78 } | 78 } |
79 | 79 |
80 private: | 80 private: |
81 typedef std::map<std::wstring, FieldTrial*> RegistrationList; | 81 typedef std::map<std::wstring, FieldTrial*> RegistrationList; |
82 | 82 |
83 friend class FieldTrialTest; | |
84 static void ResetConstructorCountForTestingOnly() { constructor_count_ = 0; } | |
85 | |
86 static FieldTrialList* global_; // The singleton of this class. | 83 static FieldTrialList* global_; // The singleton of this class. |
87 static int constructor_count_; // Prevent having more than one. | |
88 | 84 |
89 base::Time application_start_time_; | 85 base::Time application_start_time_; |
90 RegistrationList registered_; | 86 RegistrationList registered_; |
91 | 87 |
92 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); | 88 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); |
93 }; | 89 }; |
94 | 90 |
95 #endif // BASE_FIELD_TRIAL_H_ | 91 #endif // BASE_FIELD_TRIAL_H_ |
OLD | NEW |