| 6 | * tree. An additional intellectual property rights grant can be found |
| 7 | * in the file PATENTS. All contributing project authors may |
| 8 | * be found in the AUTHORS file in the root of the source tree. |
| 9 | */ |
| 10 | #include "api/field_trials_registry.h" |
| 11 |
| 12 | #include <string> |
| 13 |
| 14 | #include "absl/algorithm/container.h" |
| 15 | #include "absl/strings/string_view.h" |
| 16 | #include "rtc_base/checks.h" |
| 17 | #include "rtc_base/containers/flat_set.h" |
| 18 | #include "rtc_base/logging.h" |
| 19 |
| 20 | namespace webrtc { |
| 21 |
| 22 | std::string FieldTrialsRegistry::Lookup(absl::string_view key) const { |
| 23 | #if WEBRTC_STRICT_FIELD_TRIALS == 1 |
| 24 | RTC_DCHECK(absl::c_linear_search(kRegisteredFieldTrials, key) || |
| 25 | test_keys_.contains(key)) |
| 26 | << key << " is not registered, see g3doc/field-trials.md."; |
| 27 | #elif WEBRTC_STRICT_FIELD_TRIALS == 2 |
| 28 | RTC_LOG_IF(LS_WARNING, !(absl::c_linear_search(kRegisteredFieldTrials, key) || |
| 29 | test_keys_.contains(key))) |
| 30 | << key << " is not registered, see g3doc/field-trials.md."; |
| 31 | #endif |
| 32 | return GetValue(key); |
| 33 | } |
| 34 |
| 35 | } // namespace webrtc |
| 36 |