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

Side by Side Diff: base/field_trial.h

Issue 18535: Decrements FieldTrialList::constructor_count_ in the destructor. I'm... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 11 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | base/field_trial.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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_
OLDNEW
« no previous file with comments | « no previous file | base/field_trial.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698