| OLD | NEW |
| 1 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. | 1 // Copyright (c) 2014 The WebRTC project authors. All Rights Reserved. |
| 2 // | 2 // |
| 3 // Use of this source code is governed by a BSD-style license | 3 // Use of this source code is governed by a BSD-style license |
| 4 // that can be found in the LICENSE file in the root of the source | 4 // that can be found in the LICENSE file in the root of the source |
| 5 // tree. An additional intellectual property rights grant can be found | 5 // tree. An additional intellectual property rights grant can be found |
| 6 // in the file PATENTS. All contributing project authors may | 6 // in the file PATENTS. All contributing project authors may |
| 7 // be found in the AUTHORS file in the root of the source tree. | 7 // be found in the AUTHORS file in the root of the source tree. |
| 8 // | 8 // |
| 9 | 9 |
| 10 #include "webrtc/system_wrappers/include/field_trial.h" | 10 #include "webrtc/system_wrappers/include/field_trial.h" |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 std::string field_value(trials_string, field_name_end + 1, | 46 std::string field_value(trials_string, field_name_end + 1, |
| 47 field_value_end - field_name_end - 1); | 47 field_value_end - field_name_end - 1); |
| 48 next_item = field_value_end + 1; | 48 next_item = field_value_end + 1; |
| 49 | 49 |
| 50 if (name == field_name) | 50 if (name == field_name) |
| 51 return field_value; | 51 return field_value; |
| 52 } | 52 } |
| 53 return std::string(); | 53 return std::string(); |
| 54 } | 54 } |
| 55 | 55 |
| 56 bool IsEnabled(const char* name) { |
| 57 return FindFullName(name).find("Enabled") == 0; |
| 58 } |
| 59 |
| 56 // Optionally initialize field trial from a string. | 60 // Optionally initialize field trial from a string. |
| 57 void InitFieldTrialsFromString(const char* trials_string) { | 61 void InitFieldTrialsFromString(const char* trials_string) { |
| 58 trials_init_string = trials_string; | 62 trials_init_string = trials_string; |
| 59 } | 63 } |
| 60 | 64 |
| 61 const char* GetFieldTrialString() { | 65 const char* GetFieldTrialString() { |
| 62 return trials_init_string; | 66 return trials_init_string; |
| 63 } | 67 } |
| 64 | 68 |
| 65 } // namespace field_trial | 69 } // namespace field_trial |
| 66 } // namespace webrtc | 70 } // namespace webrtc |
| OLD | NEW |