Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/feature_list.h" | 5 #include "base/feature_list.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 18 matching lines...) Expand all Loading... | |
| 29 // are used in command-line API functions that require ASCII) and whether there | 29 // are used in command-line API functions that require ASCII) and whether there |
| 30 // are any reserved characters present, returning true if the string is valid. | 30 // are any reserved characters present, returning true if the string is valid. |
| 31 // Only called in DCHECKs. | 31 // Only called in DCHECKs. |
| 32 bool IsValidFeatureOrFieldTrialName(const std::string& name) { | 32 bool IsValidFeatureOrFieldTrialName(const std::string& name) { |
| 33 return IsStringASCII(name) && name.find_first_of(",<*") == std::string::npos; | 33 return IsStringASCII(name) && name.find_first_of(",<*") == std::string::npos; |
| 34 } | 34 } |
| 35 | 35 |
| 36 } // namespace | 36 } // namespace |
| 37 | 37 |
| 38 FeatureList::FeatureList() | 38 FeatureList::FeatureList() |
| 39 : initialized_(false), | 39 : initialized_(false), initialized_from_command_line_(false) {} |
|
Changwan Ryu
2016/04/04 06:23:13
please remove unnecessary changes from this patch
yabinh
2016/04/04 08:31:51
Acknowledged.
| |
| 40 initialized_from_command_line_(false) { | |
| 41 } | |
| 42 | 40 |
| 43 FeatureList::~FeatureList() {} | 41 FeatureList::~FeatureList() {} |
| 44 | 42 |
| 45 void FeatureList::InitializeFromCommandLine( | 43 void FeatureList::InitializeFromCommandLine( |
| 46 const std::string& enable_features, | 44 const std::string& enable_features, |
| 47 const std::string& disable_features) { | 45 const std::string& disable_features) { |
| 48 DCHECK(!initialized_); | 46 DCHECK(!initialized_); |
| 49 | 47 |
| 50 // Process disabled features first, so that disabled ones take precedence over | 48 // Process disabled features first, so that disabled ones take precedence over |
| 51 // enabled ones (since RegisterOverride() uses insert()). | 49 // enabled ones (since RegisterOverride() uses insert()). |
| (...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 266 return it->second == &feature; | 264 return it->second == &feature; |
| 267 } | 265 } |
| 268 | 266 |
| 269 FeatureList::OverrideEntry::OverrideEntry(OverrideState overridden_state, | 267 FeatureList::OverrideEntry::OverrideEntry(OverrideState overridden_state, |
| 270 FieldTrial* field_trial) | 268 FieldTrial* field_trial) |
| 271 : overridden_state(overridden_state), | 269 : overridden_state(overridden_state), |
| 272 field_trial(field_trial), | 270 field_trial(field_trial), |
| 273 overridden_by_field_trial(field_trial != nullptr) {} | 271 overridden_by_field_trial(field_trial != nullptr) {} |
| 274 | 272 |
| 275 } // namespace base | 273 } // namespace base |
| OLD | NEW |