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 | 5 |
6 #include "base/field_trial.h" | 6 #include "base/field_trial.h" |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/rand_util.h" | 8 #include "base/rand_util.h" |
9 | 9 |
| 10 using base::Time; |
| 11 |
10 //------------------------------------------------------------------------------ | 12 //------------------------------------------------------------------------------ |
11 // FieldTrialList methods and members. | 13 // FieldTrialList methods and members. |
12 | 14 |
13 // static | 15 // static |
14 FieldTrialList* FieldTrialList::global_ = NULL; | 16 FieldTrialList* FieldTrialList::global_ = NULL; |
15 | 17 |
16 // static | 18 // static |
17 int FieldTrialList::constructor_count_ = 0; | 19 int FieldTrialList::constructor_count_ = 0; |
18 | 20 |
19 FieldTrialList::FieldTrialList() | 21 FieldTrialList::FieldTrialList() |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 //------------------------------------------------------------------------------ | 55 //------------------------------------------------------------------------------ |
54 // FieldTrial methods and members. | 56 // FieldTrial methods and members. |
55 | 57 |
56 FieldTrial::FieldTrial(const std::wstring& name, double probability) | 58 FieldTrial::FieldTrial(const std::wstring& name, double probability) |
57 : name_(name) { | 59 : name_(name) { |
58 double rand = base::RandDouble(); | 60 double rand = base::RandDouble(); |
59 DCHECK(rand >= 0.0 && rand < 1.0); | 61 DCHECK(rand >= 0.0 && rand < 1.0); |
60 boolean_value_ = rand < probability; | 62 boolean_value_ = rand < probability; |
61 FieldTrialList::Register(this); | 63 FieldTrialList::Register(this); |
62 } | 64 } |
OLD | NEW |