| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #include "base/metrics/field_trial.h" | 5 #include "base/metrics/field_trial.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
| 9 #include "base/stringprintf.h" | 9 #include "base/stringprintf.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 big_string.append(1, kHistogramFieldTrialSeparator); | 107 big_string.append(1, kHistogramFieldTrialSeparator); |
| 108 return big_string.append(FieldTrialList::FindFullName(trial_name)); | 108 return big_string.append(FieldTrialList::FindFullName(trial_name)); |
| 109 } | 109 } |
| 110 | 110 |
| 111 // static | 111 // static |
| 112 void FieldTrial::EnableBenchmarking() { | 112 void FieldTrial::EnableBenchmarking() { |
| 113 DCHECK_EQ(0u, FieldTrialList::GetFieldTrialCount()); | 113 DCHECK_EQ(0u, FieldTrialList::GetFieldTrialCount()); |
| 114 enable_benchmarking_ = true; | 114 enable_benchmarking_ = true; |
| 115 } | 115 } |
| 116 | 116 |
| 117 FieldTrial::~FieldTrial() {} |
| 118 |
| 117 // static | 119 // static |
| 118 Time FieldTrial::GetBuildTime() { | 120 Time FieldTrial::GetBuildTime() { |
| 119 Time integral_build_time; | 121 Time integral_build_time; |
| 120 const char* kDateTime = __DATE__ " " __TIME__; | 122 const char* kDateTime = __DATE__ " " __TIME__; |
| 121 bool result = Time::FromString(ASCIIToWide(kDateTime).c_str(), | 123 bool result = Time::FromString(ASCIIToWide(kDateTime).c_str(), |
| 122 &integral_build_time); | 124 &integral_build_time); |
| 123 DCHECK(result); | 125 DCHECK(result); |
| 124 return integral_build_time; | 126 return integral_build_time; |
| 125 } | 127 } |
| 126 | 128 |
| 127 FieldTrial::~FieldTrial() {} | |
| 128 | |
| 129 //------------------------------------------------------------------------------ | 129 //------------------------------------------------------------------------------ |
| 130 // FieldTrialList methods and members. | 130 // FieldTrialList methods and members. |
| 131 | 131 |
| 132 // static | 132 // static |
| 133 FieldTrialList* FieldTrialList::global_ = NULL; | 133 FieldTrialList* FieldTrialList::global_ = NULL; |
| 134 | 134 |
| 135 // static | 135 // static |
| 136 bool FieldTrialList::register_without_global_ = false; | 136 bool FieldTrialList::register_without_global_ = false; |
| 137 | 137 |
| 138 FieldTrialList::FieldTrialList() : application_start_time_(TimeTicks::Now()) { | 138 FieldTrialList::FieldTrialList() : application_start_time_(TimeTicks::Now()) { |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 263 } | 263 } |
| 264 | 264 |
| 265 FieldTrial* FieldTrialList::PreLockedFind(const std::string& name) { | 265 FieldTrial* FieldTrialList::PreLockedFind(const std::string& name) { |
| 266 RegistrationList::iterator it = registered_.find(name); | 266 RegistrationList::iterator it = registered_.find(name); |
| 267 if (registered_.end() == it) | 267 if (registered_.end() == it) |
| 268 return NULL; | 268 return NULL; |
| 269 return it->second; | 269 return it->second; |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace base | 272 } // namespace base |
| OLD | NEW |