| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 7 #include <algorithm> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/base_switches.h" | 10 #include "base/base_switches.h" |
| (...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1318 return it->second; | 1318 return it->second; |
| 1319 } | 1319 } |
| 1320 | 1320 |
| 1321 // static | 1321 // static |
| 1322 void FieldTrialList::Register(FieldTrial* trial) { | 1322 void FieldTrialList::Register(FieldTrial* trial) { |
| 1323 if (!global_) { | 1323 if (!global_) { |
| 1324 used_without_global_ = true; | 1324 used_without_global_ = true; |
| 1325 return; | 1325 return; |
| 1326 } | 1326 } |
| 1327 AutoLock auto_lock(global_->lock_); | 1327 AutoLock auto_lock(global_->lock_); |
| 1328 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); | 1328 CHECK(!global_->PreLockedFind(trial->trial_name())); |
| 1329 trial->AddRef(); | 1329 trial->AddRef(); |
| 1330 trial->SetTrialRegistered(); | 1330 trial->SetTrialRegistered(); |
| 1331 global_->registered_[trial->trial_name()] = trial; | 1331 global_->registered_[trial->trial_name()] = trial; |
| 1332 } | 1332 } |
| 1333 | 1333 |
| 1334 } // namespace base | 1334 } // namespace base |
| OLD | NEW |