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

Side by Side Diff: base/field_trial.h

Issue 8018: Clean up filter and content encoding handling ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month 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 | « base/base_lib.scons ('k') | net/base/bzip2_filter_unittest.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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 // The Find() method can be used to test to see if a named Trial was already 64 // The Find() method can be used to test to see if a named Trial was already
65 // registered, or to retrieve a pointer to it from the global map. 65 // registered, or to retrieve a pointer to it from the global map.
66 static FieldTrial* Find(const std::wstring& name); 66 static FieldTrial* Find(const std::wstring& name);
67 67
68 // The time of construction of the global map is recorded in a static variable 68 // The time of construction of the global map is recorded in a static variable
69 // and is commonly used by experiments to identify the time since the start 69 // and is commonly used by experiments to identify the time since the start
70 // of the application. In some experiments it may be useful to discount 70 // of the application. In some experiments it may be useful to discount
71 // data that is gathered before the application has reach sufficient 71 // data that is gathered before the application has reach sufficient
72 // stability (example: most DLL have loaded, etc.) 72 // stability (example: most DLL have loaded, etc.)
73 static Time application_start_time() { 73 static Time application_start_time() {
74 return global_->application_start_time_; 74 if (global_)
75 return global_->application_start_time_;
76 // For testing purposes only, or when we don't yet have a start time.
77 return Time::Now();
75 } 78 }
76 79
77 private: 80 private:
78 typedef std::map<std::wstring, FieldTrial*> RegistrationList; 81 typedef std::map<std::wstring, FieldTrial*> RegistrationList;
79 82
80 friend class FieldTrialTest; 83 friend class FieldTrialTest;
81 static void ResetConstructorCountForTestingOnly() { constructor_count_ = 0; } 84 static void ResetConstructorCountForTestingOnly() { constructor_count_ = 0; }
82 85
83 static FieldTrialList* global_; // The singleton of this class. 86 static FieldTrialList* global_; // The singleton of this class.
84 static int constructor_count_; // Prevent having more than one. 87 static int constructor_count_; // Prevent having more than one.
85 88
86 Time application_start_time_; 89 Time application_start_time_;
87 RegistrationList registered_; 90 RegistrationList registered_;
88 91
89 DISALLOW_COPY_AND_ASSIGN(FieldTrialList); 92 DISALLOW_COPY_AND_ASSIGN(FieldTrialList);
90 }; 93 };
91 94
92 #endif // BASE_FIELD_TRIAL_H_ 95 #endif // BASE_FIELD_TRIAL_H_
OLDNEW
« no previous file with comments | « base/base_lib.scons ('k') | net/base/bzip2_filter_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698