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 1119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1130 } | 1130 } |
1131 return entries; | 1131 return entries; |
1132 } | 1132 } |
1133 | 1133 |
1134 #if defined(OS_WIN) | 1134 #if defined(OS_WIN) |
1135 // static | 1135 // static |
1136 bool FieldTrialList::CreateTrialsFromHandleSwitch( | 1136 bool FieldTrialList::CreateTrialsFromHandleSwitch( |
1137 const std::string& handle_switch) { | 1137 const std::string& handle_switch) { |
1138 int field_trial_handle = std::stoi(handle_switch); | 1138 int field_trial_handle = std::stoi(handle_switch); |
1139 HANDLE handle = reinterpret_cast<HANDLE>(field_trial_handle); | 1139 HANDLE handle = reinterpret_cast<HANDLE>(field_trial_handle); |
1140 SharedMemoryHandle shm_handle(handle, GetCurrentProcId()); | 1140 SharedMemoryHandle shm_handle(handle); |
1141 return FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle); | 1141 return FieldTrialList::CreateTrialsFromSharedMemoryHandle(shm_handle); |
1142 } | 1142 } |
1143 #endif | 1143 #endif |
1144 | 1144 |
1145 #if defined(OS_POSIX) && !defined(OS_NACL) | 1145 #if defined(OS_POSIX) && !defined(OS_NACL) |
1146 // static | 1146 // static |
1147 bool FieldTrialList::CreateTrialsFromDescriptor(int fd_key) { | 1147 bool FieldTrialList::CreateTrialsFromDescriptor(int fd_key) { |
1148 if (!kUseSharedMemoryForFieldTrials) | 1148 if (!kUseSharedMemoryForFieldTrials) |
1149 return false; | 1149 return false; |
1150 | 1150 |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1353 return; | 1353 return; |
1354 } | 1354 } |
1355 AutoLock auto_lock(global_->lock_); | 1355 AutoLock auto_lock(global_->lock_); |
1356 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); | 1356 CHECK(!global_->PreLockedFind(trial->trial_name())) << trial->trial_name(); |
1357 trial->AddRef(); | 1357 trial->AddRef(); |
1358 trial->SetTrialRegistered(); | 1358 trial->SetTrialRegistered(); |
1359 global_->registered_[trial->trial_name()] = trial; | 1359 global_->registered_[trial->trial_name()] = trial; |
1360 } | 1360 } |
1361 | 1361 |
1362 } // namespace base | 1362 } // namespace base |
OLD | NEW |