| 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" |
| 11 #include "webrtc/system_wrappers/include/field_trial_default.h" | 11 #include "webrtc/system_wrappers/include/field_trial_default.h" |
| 12 | 12 |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 // Simple field trial implementation, which allows client to | 15 // Simple field trial implementation, which allows client to |
| 16 // specify desired flags in InitFieldTrialsFromString. | 16 // specify desired flags in InitFieldTrialsFromString. |
| 17 namespace webrtc { | 17 namespace webrtc { |
| 18 namespace field_trial { | 18 namespace field_trial { |
| 19 | 19 |
| 20 static const char *trials_init_string = NULL; | 20 static const char* trials_init_string = nullptr; |
| 21 | 21 |
| 22 std::string FindFullName(const std::string& name) { | 22 std::string FindFullName(const std::string& name) { |
| 23 if (trials_init_string == NULL) | 23 if (trials_init_string == nullptr) |
| 24 return std::string(); | 24 return std::string(); |
| 25 | 25 |
| 26 std::string trials_string(trials_init_string); | 26 std::string trials_string(trials_init_string); |
| 27 if (trials_string.empty()) | 27 if (trials_string.empty()) |
| 28 return std::string(); | 28 return std::string(); |
| 29 | 29 |
| 30 static const char kPersistentStringSeparator = '/'; | 30 static const char kPersistentStringSeparator = '/'; |
| 31 size_t next_item = 0; | 31 size_t next_item = 0; |
| 32 while (next_item < trials_string.length()) { | 32 while (next_item < trials_string.length()) { |
| 33 | 33 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 57 void InitFieldTrialsFromString(const char* trials_string) { | 57 void InitFieldTrialsFromString(const char* trials_string) { |
| 58 trials_init_string = trials_string; | 58 trials_init_string = trials_string; |
| 59 } | 59 } |
| 60 | 60 |
| 61 const char* GetFieldTrialString() { | 61 const char* GetFieldTrialString() { |
| 62 return trials_init_string; | 62 return trials_init_string; |
| 63 } | 63 } |
| 64 | 64 |
| 65 } // namespace field_trial | 65 } // namespace field_trial |
| 66 } // namespace webrtc | 66 } // namespace webrtc |
| OLD | NEW |